#[repr(C)]pub struct BlockUnitCount(/* private fields */);
Expand description
Represents the buc
field of the Argument.
Implementations§
Source§impl BlockUnitCount
impl BlockUnitCount
Sourcepub const fn bits(&self) -> u16
pub const fn bits(&self) -> u16
Gets the bit value for BlockUnitCount.
Source§impl BlockUnitCount
impl BlockUnitCount
Sourcepub const LEN: usize = 2usize
pub const LEN: usize = 2usize
Represents the byte length of the BlockUnitCount.
Sourcepub const DEFAULT: u16 = 0u16
pub const DEFAULT: u16 = 0u16
Represents the default inner value of the BlockUnitCount.
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new BlockUnitCount.
Sourcepub const fn count(&self) -> u16
pub const fn count(&self) -> u16
Gets the block unit count.
§Note
The returned value is already adjusted for the semantic count: raw_count + 1
.
Sourcepub fn set_count(&mut self, val: u16)
pub fn set_count(&mut self, val: u16)
Gets the block unit count.
§Note
The set value is automatically adjusted for the semantic count: val - 1
.
Sourcepub const fn from_bits_unchecked(val: u16) -> Self
pub const fn from_bits_unchecked(val: u16) -> Self
Converts a u16
into a BlockUnitCount.
§Safety
Caller is responsible for checking that val
is in the valid range: MIN to MAX.
Sourcepub const fn try_from_bits(val: u16) -> Result<Self>
pub const fn try_from_bits(val: u16) -> Result<Self>
Attempts to convert a u16
into a BlockUnitCount.
§Note
Converts the unadjusted value into the BlockUnitCount.
Sourcepub const fn try_from_bytes(val: &[u8]) -> Result<Self>
pub const fn try_from_bytes(val: &[u8]) -> Result<Self>
Attempts to convert a byte slice into a BlockUnitCount.
§Note
Converts the unadjusted value into the BlockUnitCount.
Sourcepub const fn bytes(&self) -> [u8; 2]
pub const fn bytes(&self) -> [u8; 2]
Converts the BlockUnitCount into a byte array.
Trait Implementations§
Source§impl Clone for BlockUnitCount
impl Clone for BlockUnitCount
Source§fn clone(&self) -> BlockUnitCount
fn clone(&self) -> BlockUnitCount
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more