pub fn new_free(container: T, index: u32, order: usize, next_free: u32) -> Result<Self, Error> {
        if order >= constants::NUM_ORDERS {
            return Err(format_err!("Order {} must be less than {}", order, constants::NUM_ORDERS));
        }
        let mut header = BlockHeader(0);
        header.set_order(order.to_u8().unwrap());
        header.set_block_type(BlockType::Free.to_u8().unwrap());
        header.set_free_next_index(next_free);
        let block = Block::new(container, index);
        block.write_header(header);
        Ok(block)
    }
/// Initializes an empty reserved block.
Initializes an empty reserved block.
Initializes an empty reserved block .
pub fn new_free(container: T, index: u32, order: usize, next_free: u32) -> Result<Self, Error> {
        if order >= constants::NUM_ORDERS {
            return Err(format_err!("Order {} must be less than {}", order, constants::NUM_ORDERS));
        }
        let mut header = BlockHeader(0);
        header.set_order(order.to_u8().unwrap());
        header.set_block_type(BlockType::Free.to_u8().unwrap());
        header.set_free_next_index(next_free);
        let block = Block::new(container, index);
        block.write_header(header);
        Ok(block)
    }
pub fn new_free ( container : T , index : u32 , order : usize , next_free : u32 ) -> Result < Self , Error > { if order >= constants :: NUM_ORDERS { return Err ( format_err ! ( " " order constants NUM_ORDERS ) ) ; } let mut header = BlockHeader ( 0 ) ; header . set_order ( order . to_u8 ( ) . unwrap ( ) ) ; header . set_block_type ( BlockType :: Free . to_u8 ( ) . unwrap ( ) ) ; header . set_free_next_index ( next_free ) ; let block = Block :: new ( container , index ) ; block . write_header ( header ) ; Ok ( block ) }
Initializes an empty reserved block.
Initializes an empty reserved block .
container
T
index
u32
order
usize
next_free
u32
container
T
index
u32
order
usize
next_free
u32