Struct BitFieldImpl

Source
pub struct BitFieldImpl<TOwner, Shift, Mask> { /* private fields */ }
Expand description

Marker type representing an owned bitfield. TOwner is the owning type of the bitfield. Shift and Mask are typenum::Unsigned types representing the shift and mask values used to access the bitfield. These are both converted to constants in the BitFieldTrait implemented for this struct.

While this type can be used directly, it is more convenient to use the BitField type alias to define a bit range rather than the lower-level shift and mask.

Trait Implementations§

Source§

impl<TOwner, TShift, TMask> BitFieldTrait for BitFieldImpl<TOwner, TShift, TMask>
where TShift: Unsigned, TMask: Unsigned,

Implementation for BitFieldImpl explicitly converts the typenum shift and mask calculations into constants. Forcing the conversion here prevents infinite recursion by the compiler when these values are used by Storage to provide access to the field.

Source§

const SHIFT: u32 = TShift::U32

The number of bits the field is shifted in the owner
Source§

const MASK: u64 = TMask::U64

The bit mask used to to select or clear the field bits in the owner
Source§

type Owner = TOwner

The owner, typically a Storage, bound to this bit field

Auto Trait Implementations§

§

impl<TOwner, Shift, Mask> Freeze for BitFieldImpl<TOwner, Shift, Mask>

§

impl<TOwner, Shift, Mask> RefUnwindSafe for BitFieldImpl<TOwner, Shift, Mask>
where TOwner: RefUnwindSafe, Shift: RefUnwindSafe, Mask: RefUnwindSafe,

§

impl<TOwner, Shift, Mask> Send for BitFieldImpl<TOwner, Shift, Mask>
where TOwner: Send, Shift: Send, Mask: Send,

§

impl<TOwner, Shift, Mask> Sync for BitFieldImpl<TOwner, Shift, Mask>
where TOwner: Sync, Shift: Sync, Mask: Sync,

§

impl<TOwner, Shift, Mask> Unpin for BitFieldImpl<TOwner, Shift, Mask>
where TOwner: Unpin, Shift: Unpin, Mask: Unpin,

§

impl<TOwner, Shift, Mask> UnwindSafe for BitFieldImpl<TOwner, Shift, Mask>
where TOwner: UnwindSafe, Shift: UnwindSafe, Mask: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.