pub struct B16(/* private fields */);
Expand description
a type used to represent a field with a specific amount of bits.
Implementations§
Source§impl B16
impl B16
Sourcepub const BIT_LENGTH: usize = 16usize
pub const BIT_LENGTH: usize = 16usize
the bit length of this type.
Sourcepub fn new(value: <BitLength<16> as AssociatedStorage>::Storage) -> Option<Self>
pub fn new(value: <BitLength<16> as AssociatedStorage>::Storage) -> Option<Self>
creates a new instance of this bitfield type with the given value.
if the value does not fit within the bit length of this type, returns None
.
Sourcepub unsafe fn new_unchecked(
value: <BitLength<16> as AssociatedStorage>::Storage,
) -> Self
pub unsafe fn new_unchecked( value: <BitLength<16> as AssociatedStorage>::Storage, ) -> Self
creates a new instance of this bitfield type with the given value, without checking that the value fits within the bit length of this type.
§safety
the provided value must fit withing the bit length of this type.
Sourcepub fn get(&self) -> <BitLength<16> as AssociatedStorage>::Storage
pub fn get(&self) -> <BitLength<16> as AssociatedStorage>::Storage
returns the inner value.
Trait Implementations§
Source§impl BitPiece for B16
impl BitPiece for B16
Source§type Bits = <BitLength<16> as AssociatedStorage>::Storage
type Bits = <BitLength<16> as AssociatedStorage>::Storage
the storage type used internally to store the bits of this bitpiece.
Source§type Mut<'s, S: BitStorage + 's> = GenericBitPieceMut<'s, S, B16>
type Mut<'s, S: BitStorage + 's> = GenericBitPieceMut<'s, S, B16>
the type used to represent a mutable reference to this type inside another bitpiece.
Source§fn from_fields(fields: Self::Fields) -> Self
fn from_fields(fields: Self::Fields) -> Self
constructs this type from the given fields.
Source§impl Ord for B16
impl Ord for B16
Source§impl PartialOrd for B16
impl PartialOrd for B16
impl Copy for B16
impl Eq for B16
impl StructuralPartialEq for B16
Auto Trait Implementations§
impl Freeze for B16
impl RefUnwindSafe for B16
impl Send for B16
impl Sync for B16
impl Unpin for B16
impl UnwindSafe for B16
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