pub struct TestBitfield(/* private fields */);Expand description
Struct with the actual data.
Trait Implementations§
Source§impl Bitfield for TestBitfield
impl Bitfield for TestBitfield
Source§impl Clone for TestBitfield
impl Clone for TestBitfield
Source§fn clone(&self) -> TestBitfield
fn clone(&self) -> TestBitfield
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TestBitfield
impl Debug for TestBitfield
Source§impl Deref for TestBitfield
Implement this so that accesses to fields of $bitfield_name
actually access the zero-sized struct Fields
impl Deref for TestBitfield
Implement this so that accesses to fields of $bitfield_name
actually access the zero-sized struct Fields
Source§impl DerefMut for TestBitfield
impl DerefMut for TestBitfield
Source§impl Display for TestBitfield
impl Display for TestBitfield
Source§impl Field<TestBitfield> for field_1
impl Field<TestBitfield> for field_1
Source§const OFFSET: u8 = 0
const OFFSET: u8 = 0
The field’s offset from the underlying value’s least significant bit,
in bits. Read more
Source§const MASK: <TestBitfield as Bitfield>::BaseType
const MASK: <TestBitfield as Bitfield>::BaseType
The field’s mask that can be used to extract the last Self::SIZE bits from any
B::BaseType.
Computed automatically. Read moreSource§const VALID: bool = _
const VALID: bool = _
true if the field is within the bitfield’s bounds. Used for compile-time checking.Source§fn size(&self) -> u8
fn size(&self) -> u8
Returns the size of a field at runtime, while Self::SIZE is used on the type of the field at compile-time.
Source§fn offset(&self) -> u8
fn offset(&self) -> u8
Returns the offset of a field at runtime, while Self::OFFSET is used on the type of the field at compile-time.
Source§fn mask(&self) -> B::BaseType
fn mask(&self) -> B::BaseType
Returns the mask of a field at runtime, while Self::MASK is used on the type of the field at compile-time.
Source§fn set(&mut self, new_value: B::BaseType)
fn set(&mut self, new_value: B::BaseType)
Sets the value of a field. If the value is wider than the field,
the value’s lowest Self::SIZE bits will be used. Read more
Source§fn set_checked(&mut self, new_value: B::BaseType) -> Result<(), B::BaseType>
fn set_checked(&mut self, new_value: B::BaseType) -> Result<(), B::BaseType>
Sets the value of a field. If the value is wider than the field,
returns an
Err result containing the value’s lowest Self::SIZE bits
and doesn’t modify the field. Read moreSource§impl Field<TestBitfield> for field_2
impl Field<TestBitfield> for field_2
Source§const OFFSET: u8
const OFFSET: u8
The field’s offset from the underlying value’s least significant bit,
in bits. Read more
Source§const MASK: <TestBitfield as Bitfield>::BaseType
const MASK: <TestBitfield as Bitfield>::BaseType
The field’s mask that can be used to extract the last Self::SIZE bits from any
B::BaseType.
Computed automatically. Read moreSource§const VALID: bool = _
const VALID: bool = _
true if the field is within the bitfield’s bounds. Used for compile-time checking.Source§fn size(&self) -> u8
fn size(&self) -> u8
Returns the size of a field at runtime, while Self::SIZE is used on the type of the field at compile-time.
Source§fn offset(&self) -> u8
fn offset(&self) -> u8
Returns the offset of a field at runtime, while Self::OFFSET is used on the type of the field at compile-time.
Source§fn mask(&self) -> B::BaseType
fn mask(&self) -> B::BaseType
Returns the mask of a field at runtime, while Self::MASK is used on the type of the field at compile-time.
Source§fn set(&mut self, new_value: B::BaseType)
fn set(&mut self, new_value: B::BaseType)
Sets the value of a field. If the value is wider than the field,
the value’s lowest Self::SIZE bits will be used. Read more
Source§fn set_checked(&mut self, new_value: B::BaseType) -> Result<(), B::BaseType>
fn set_checked(&mut self, new_value: B::BaseType) -> Result<(), B::BaseType>
Sets the value of a field. If the value is wider than the field,
returns an
Err result containing the value’s lowest Self::SIZE bits
and doesn’t modify the field. Read moreSource§impl From<TestBitfield> for u32
impl From<TestBitfield> for u32
Source§fn from(val: TestBitfield) -> Self
fn from(val: TestBitfield) -> Self
Converts to this type from the input type.
Source§impl From<u32> for TestBitfield
impl From<u32> for TestBitfield
impl Copy for TestBitfield
Auto Trait Implementations§
impl Freeze for TestBitfield
impl RefUnwindSafe for TestBitfield
impl Send for TestBitfield
impl Sync for TestBitfield
impl Unpin for TestBitfield
impl UnsafeUnpin for TestBitfield
impl UnwindSafe for TestBitfield
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