pub struct BlockInfo(pub u32);
Expand description
Type for interpreting block1
and block2
option values.
Tuple Fields§
§0: u32
Implementations§
Source§impl BlockInfo
impl BlockInfo
Sourcepub fn new(num: u32, m: bool, szx: u8) -> Option<BlockInfo>
pub fn new(num: u32, m: bool, szx: u8) -> Option<BlockInfo>
Constructs a new BlockInfo
from the number, more flag, and size exponent.
Sourcepub fn is_max_block(&self) -> bool
pub fn is_max_block(&self) -> bool
Determines if calling BlockInfo::next
will yield the next block or not.
If this method returns true, calling BlockInfo::next
will fail.
Sourcepub fn is_invalid(&self) -> bool
pub fn is_invalid(&self) -> bool
Checks the validity of the contained value.
Sourcepub fn valid(self) -> Option<BlockInfo>
pub fn valid(self) -> Option<BlockInfo>
Checks the contained value for validity and, if valid, returns it in an Option
.
Sourcepub fn smaller(&self) -> Option<BlockInfo>
pub fn smaller(&self) -> Option<BlockInfo>
Calculates a smaller block size that maintains this block’s offset.
Sourcepub fn with_more_flag(&self) -> BlockInfo
pub fn with_more_flag(&self) -> BlockInfo
Returns this BlockInfo
’s value with the more flag set.
Sourcepub fn without_more_flag(&self) -> BlockInfo
pub fn without_more_flag(&self) -> BlockInfo
Returns this BlockInfo
’s value without the more flag set.
Trait Implementations§
Source§impl Ord for BlockInfo
impl Ord for BlockInfo
Source§impl PartialOrd for BlockInfo
impl PartialOrd for BlockInfo
impl Copy for BlockInfo
impl Eq for BlockInfo
impl StructuralPartialEq for BlockInfo
Auto Trait Implementations§
impl Freeze for BlockInfo
impl RefUnwindSafe for BlockInfo
impl Send for BlockInfo
impl Sync for BlockInfo
impl Unpin for BlockInfo
impl UnwindSafe for BlockInfo
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