pub fn add_root(&mut self, offset: u64, data: T) -> Result<(), Error> {
        // SAFETY: Because we passed the assertion above which implies no other access is possible as per
        // standard borrow check rules.
        #[allow(unsafe_code)]
        let items = unsafe { &mut *(self.items.get()) };
        let offset = self.assert_is_incrementing(offset)?;
        items.push(Item {
            offset,
            data,
            is_root: true,
            children: Default::default(),
        });
        self.one_past_last_seen_root = items.len();
        Ok(())
    }
/// Add a new root node, one that only has children but is not a child itself, at the given pack `offset` and associate
/// custom `data` with it.
Add a new root node, one that only has children but is not a child itself, at the given pack `offset` and associate
custom `data` with it.
Add a new root node one that only has children but is not a child itself at the given pack ` offset ` and associate custom ` data ` with it .
pub fn add_root(&mut self, offset: u64, data: T) -> Result<(), Error> {
        // SAFETY: Because we passed the assertion above which implies no other access is possible as per
        // standard borrow check rules.
        #[allow(unsafe_code)]
        let items = unsafe { &mut *(self.items.get()) };
        let offset = self.assert_is_incrementing(offset)?;
        items.push(Item {
            offset,
            data,
            is_root: true,
            children: Default::default(),
        });
        self.one_past_last_seen_root = items.len();
        Ok(())
    }
pub fn add_root ( & mut self , offset : u64 , data : T ) -> Result < ( ) , Error > { // SAFETY: Because we passed the assertion above which implies no other access is possible as per // standard borrow check rules. # [ allow ( unsafe_code ) ] let items = unsafe { & mut * ( self . items . get ( ) ) } ; let offset = self . assert_is_incrementing ( offset ) ? ; items . push ( Item { offset , data , is_root : true , children : Default :: default ( ) , } ) ; self . one_past_last_seen_root = items . len ( ) ; Ok ( ( ) ) }
Add a new root node, one that only has children but is not a child itself, at the given pack `offset` and associate
custom `data` with it.
Add a new root node one that only has children but is not a child itself at the given pack ` offset ` and associate custom ` data ` with it .
&mut self
offset
u64
data
T