pub fn create(db_location: &str, axis_definitions: &[AxisDefinition], create_new: bool) -> io::Result<()> {
    let library_axis_location = format!("{}{}", db_location, AXIS_FILE_NAME);
    OpenOptions::new()
        .write(true)
        .create(true)
        .create_new(create_new)
        .truncate(true)
        .open(&library_axis_location)
        ?
        .set_len(
            (1 + axis_definitions.len() as u64) * U64::VALUE_SIZE as u64
        )?;

    // unwrap should never fail
    U64::write_to_db(&library_axis_location, 0, axis_definitions.len() as u64).unwrap();

	for axis_definition in axis_definitions {
        // unwrap should never fail
		U64::write_to_db(&library_axis_location, axis_definition.id, axis_definition.max).unwrap();
    }

    Ok(())
}
// The axis definitions are stored in the axis library.  The first block contains how many dimensions exist.
// The subsequent blocks contain the max size of each dimension.
The axis definitions are stored in the axis library.  The first block contains how many dimensions exist.
The subsequent blocks contain the max size of each dimension.
The axis definitions are stored in the axis library . The first block contains how many dimensions exist . The subsequent blocks contain the max size of each dimension .
pub fn create(db_location: &str, axis_definitions: &[AxisDefinition], create_new: bool) -> io::Result<()> {
    let library_axis_location = format!("{}{}", db_location, AXIS_FILE_NAME);
    OpenOptions::new()
        .write(true)
        .create(true)
        .create_new(create_new)
        .truncate(true)
        .open(&library_axis_location)
        ?
        .set_len(
            (1 + axis_definitions.len() as u64) * U64::VALUE_SIZE as u64
        )?;
    // unwrap should never fail
    U64::write_to_db(&library_axis_location, 0, axis_definitions.len() as u64).unwrap();
	for axis_definition in axis_definitions {
        // unwrap should never fail
		U64::write_to_db(&library_axis_location, axis_definition.id, axis_definition.max).unwrap();
    }
    Ok(())
}
pub fn create ( db_location : & str , axis_definitions : & [ AxisDefinition ] , create_new : bool ) -> io :: Result < ( ) > { let library_axis_location = format ! ( " " db_location AXIS_FILE_NAME ) ; OpenOptions :: new ( ) . write ( true ) . create ( true ) . create_new ( create_new ) . truncate ( true ) . open ( & library_axis_location ) ? . set_len ( ( 1 + axis_definitions . len ( ) as u64 ) * U64 :: VALUE_SIZE as u64 ) ? ; // unwrap should never fail U64 :: write_to_db ( & library_axis_location , 0 , axis_definitions . len ( ) as u64 ) . unwrap ( ) ; for axis_definition in axis_definitions { // unwrap should never fail U64 :: write_to_db ( & library_axis_location , axis_definition . id , axis_definition . max ) . unwrap ( ) ; } Ok ( ( ) ) }
The axis definitions are stored in the axis library.
The axis definitions are stored in the axis library .
db_location
&str
axis_definitions
&[AxisDefinition]
create_new
bool
db_location
&str
axis_definitions
&[AxisDefinition]
create_new
bool