pub struct Unit(/* private fields */);
Expand description
An unit represents an element in a double-array.
Implementations§
Source§impl Unit
impl Unit
Sourcepub fn has_leaf(&self) -> bool
pub fn has_leaf(&self) -> bool
Returns true if the unit have a leaf as a child unit. Otherwise, returns false.
Sourcepub fn is_leaf(&self) -> bool
pub fn is_leaf(&self) -> bool
Returns true if the unit is a leaf which have a value. Otherwise, return false.
Sourcepub fn label(&self) -> u32
pub fn label(&self) -> u32
Returns a label (<= 255) if the unit is not a leaf. Otherwise, returns a integer greater than 255.
Sourcepub fn offset(&self) -> u32
pub fn offset(&self) -> u32
Returns an offset value within the unit. If the offset extension flag is true, returns the offset multiplied by 256.
Sourcepub fn set_offset(&mut self, offset: u32)
pub fn set_offset(&mut self, offset: u32)
Sets an offset to the unit. offset
should be a value less than or equal to 29 bits. If the
offset
is greater than 21 bits, sets the offset extension flag and the offset
without
lower 8 bits (then, lower 8 bits of the given offset
should be 0).
Sourcepub fn set_has_leaf(&mut self, has_leaf: bool)
pub fn set_has_leaf(&mut self, has_leaf: bool)
Sets a has_leaf
flag to the unit.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnwindSafe for Unit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more