Struct Storage

Source
pub struct Storage<TMarker, TData>
where TData: BitFieldAccess,
{ /* private fields */ }
Expand description

Stores a primitive value uniquely tagged with type TMarker and allows bitfield access to the value through specializations of the BitField type.

Implementations§

Source§

impl<TMarker> Storage<TMarker, u8>

Source

pub fn new() -> Self

Construct a new Storage

Source

pub fn get<TBitField>(&self) -> u8
where TBitField: BitFieldTrait<Owner = Self>,

Gets the BitField value from storage

Source

pub fn set<TBitField>(&mut self, value: u8)
where TBitField: BitFieldTrait<Owner = Self>,

Sets the BitField value in storage

Source§

impl<TMarker> Storage<TMarker, u16>

Source

pub fn new() -> Self

Construct a new Storage

Source

pub fn get<TBitField>(&self) -> u16
where TBitField: BitFieldTrait<Owner = Self>,

Gets the BitField value from storage

Source

pub fn set<TBitField>(&mut self, value: u16)
where TBitField: BitFieldTrait<Owner = Self>,

Sets the BitField value in storage

Source§

impl<TMarker> Storage<TMarker, u32>

Source

pub fn new() -> Self

Construct a new Storage

Source

pub fn get<TBitField>(&self) -> u32
where TBitField: BitFieldTrait<Owner = Self>,

Gets the BitField value from storage

Source

pub fn set<TBitField>(&mut self, value: u32)
where TBitField: BitFieldTrait<Owner = Self>,

Sets the BitField value in storage

Source§

impl<TMarker> Storage<TMarker, u64>

Source

pub fn new() -> Self

Construct a new Storage

Source

pub fn get<TBitField>(&self) -> u64
where TBitField: BitFieldTrait<Owner = Self>,

Gets the BitField value from storage

Source

pub fn set<TBitField>(&mut self, value: u64)
where TBitField: BitFieldTrait<Owner = Self>,

Sets the BitField value in storage

Source§

impl<TMarker> Storage<TMarker, usize>

Source

pub fn new() -> Self

Construct a new Storage

Source

pub fn get<TBitField>(&self) -> usize
where TBitField: BitFieldTrait<Owner = Self>,

Gets the BitField value from storage

Source

pub fn set<TBitField>(&mut self, value: usize)
where TBitField: BitFieldTrait<Owner = Self>,

Sets the BitField value in storage

Trait Implementations§

Source§

impl<TMarker> Binary for Storage<TMarker, u16>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Binary for Storage<TMarker, u32>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Binary for Storage<TMarker, u64>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Binary for Storage<TMarker, u8>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Binary for Storage<TMarker, usize>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker: Clone, TData> Clone for Storage<TMarker, TData>
where TData: BitFieldAccess + Clone,

Source§

fn clone(&self) -> Storage<TMarker, TData>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<TMarker: Debug, TData> Debug for Storage<TMarker, TData>
where TData: BitFieldAccess + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker: Default, TData> Default for Storage<TMarker, TData>
where TData: BitFieldAccess + Default,

Source§

fn default() -> Storage<TMarker, TData>

Returns the “default value” for a type. Read more
Source§

impl<TMarker> Display for Storage<TMarker, u16>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Display for Storage<TMarker, u32>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Display for Storage<TMarker, u64>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Display for Storage<TMarker, u8>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Display for Storage<TMarker, usize>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> From<u16> for Storage<TMarker, u16>

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl<TMarker> From<u16> for Storage<TMarker, u32>

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl<TMarker> From<u16> for Storage<TMarker, u64>

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl<TMarker> From<u16> for Storage<TMarker, usize>

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl<TMarker> From<u32> for Storage<TMarker, u32>

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl<TMarker> From<u32> for Storage<TMarker, u64>

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl<TMarker> From<u64> for Storage<TMarker, u64>

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl<TMarker> From<u8> for Storage<TMarker, u16>

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl<TMarker> From<u8> for Storage<TMarker, u32>

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl<TMarker> From<u8> for Storage<TMarker, u64>

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl<TMarker> From<u8> for Storage<TMarker, u8>

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl<TMarker> From<u8> for Storage<TMarker, usize>

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl<TMarker> From<usize> for Storage<TMarker, usize>

Source§

fn from(value: usize) -> Self

Converts to this type from the input type.
Source§

impl<TMarker: Hash, TData> Hash for Storage<TMarker, TData>
where TData: BitFieldAccess + Hash,

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<TMarker> LowerHex for Storage<TMarker, u16>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> LowerHex for Storage<TMarker, u32>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> LowerHex for Storage<TMarker, u64>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> LowerHex for Storage<TMarker, u8>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> LowerHex for Storage<TMarker, usize>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Octal for Storage<TMarker, u16>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Octal for Storage<TMarker, u32>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Octal for Storage<TMarker, u64>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Octal for Storage<TMarker, u8>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> Octal for Storage<TMarker, usize>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker: Ord, TData> Ord for Storage<TMarker, TData>
where TData: BitFieldAccess + Ord,

Source§

fn cmp(&self, other: &Storage<TMarker, TData>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<TMarker: PartialEq, TData> PartialEq for Storage<TMarker, TData>
where TData: BitFieldAccess + PartialEq,

Source§

fn eq(&self, other: &Storage<TMarker, TData>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<TMarker: PartialOrd, TData> PartialOrd for Storage<TMarker, TData>
where TData: BitFieldAccess + PartialOrd,

Source§

fn partial_cmp(&self, other: &Storage<TMarker, TData>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<TMarker> TryFrom<u16> for Storage<TMarker, u8>

Source§

type Error = <u8 as TryFrom<u16>>::Error

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

fn try_from(value: u16) -> Result<Self, <u8 as TryFrom<u16>>::Error>

Performs the conversion.
Source§

impl<TMarker> TryFrom<u32> for Storage<TMarker, u16>

Source§

type Error = <u16 as TryFrom<u32>>::Error

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

fn try_from(value: u32) -> Result<Self, <u16 as TryFrom<u32>>::Error>

Performs the conversion.
Source§

impl<TMarker> TryFrom<u32> for Storage<TMarker, u8>

Source§

type Error = <u8 as TryFrom<u32>>::Error

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

fn try_from(value: u32) -> Result<Self, <u8 as TryFrom<u32>>::Error>

Performs the conversion.
Source§

impl<TMarker> TryFrom<u32> for Storage<TMarker, usize>

Source§

type Error = <usize as TryFrom<u32>>::Error

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

fn try_from(value: u32) -> Result<Self, <usize as TryFrom<u32>>::Error>

Performs the conversion.
Source§

impl<TMarker> TryFrom<u64> for Storage<TMarker, u16>

Source§

type Error = <u16 as TryFrom<u64>>::Error

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

fn try_from(value: u64) -> Result<Self, <u16 as TryFrom<u64>>::Error>

Performs the conversion.
Source§

impl<TMarker> TryFrom<u64> for Storage<TMarker, u32>

Source§

type Error = <u32 as TryFrom<u64>>::Error

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

fn try_from(value: u64) -> Result<Self, <u32 as TryFrom<u64>>::Error>

Performs the conversion.
Source§

impl<TMarker> TryFrom<u64> for Storage<TMarker, u8>

Source§

type Error = <u8 as TryFrom<u64>>::Error

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

fn try_from(value: u64) -> Result<Self, <u8 as TryFrom<u64>>::Error>

Performs the conversion.
Source§

impl<TMarker> TryFrom<u64> for Storage<TMarker, usize>

Source§

type Error = <usize as TryFrom<u64>>::Error

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

fn try_from(value: u64) -> Result<Self, <usize as TryFrom<u64>>::Error>

Performs the conversion.
Source§

impl<TMarker> TryFrom<usize> for Storage<TMarker, u16>

Source§

type Error = <u16 as TryFrom<usize>>::Error

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

fn try_from(value: usize) -> Result<Self, <u16 as TryFrom<usize>>::Error>

Performs the conversion.
Source§

impl<TMarker> TryFrom<usize> for Storage<TMarker, u32>

Source§

type Error = <u32 as TryFrom<usize>>::Error

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

fn try_from(value: usize) -> Result<Self, <u32 as TryFrom<usize>>::Error>

Performs the conversion.
Source§

impl<TMarker> TryFrom<usize> for Storage<TMarker, u64>

Source§

type Error = <u64 as TryFrom<usize>>::Error

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

fn try_from(value: usize) -> Result<Self, <u64 as TryFrom<usize>>::Error>

Performs the conversion.
Source§

impl<TMarker> TryFrom<usize> for Storage<TMarker, u8>

Source§

type Error = <u8 as TryFrom<usize>>::Error

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

fn try_from(value: usize) -> Result<Self, <u8 as TryFrom<usize>>::Error>

Performs the conversion.
Source§

impl<TMarker> UpperHex for Storage<TMarker, u16>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> UpperHex for Storage<TMarker, u32>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> UpperHex for Storage<TMarker, u64>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> UpperHex for Storage<TMarker, u8>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker> UpperHex for Storage<TMarker, usize>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TMarker: Copy, TData> Copy for Storage<TMarker, TData>
where TData: BitFieldAccess + Copy,

Source§

impl<TMarker: Eq, TData> Eq for Storage<TMarker, TData>
where TData: BitFieldAccess + Eq,

Source§

impl<TMarker, TData> StructuralPartialEq for Storage<TMarker, TData>
where TData: BitFieldAccess,

Auto Trait Implementations§

§

impl<TMarker, TData> Freeze for Storage<TMarker, TData>
where TData: Freeze,

§

impl<TMarker, TData> RefUnwindSafe for Storage<TMarker, TData>
where TData: RefUnwindSafe, TMarker: RefUnwindSafe,

§

impl<TMarker, TData> Send for Storage<TMarker, TData>
where TData: Send, TMarker: Send,

§

impl<TMarker, TData> Sync for Storage<TMarker, TData>
where TData: Sync, TMarker: Sync,

§

impl<TMarker, TData> Unpin for Storage<TMarker, TData>
where TData: Unpin, TMarker: Unpin,

§

impl<TMarker, TData> UnwindSafe for Storage<TMarker, TData>
where TData: UnwindSafe, TMarker: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.