#[repr(C)]
pub struct BitfieldUnit<Storage> { /* private fields */ }

Implementationsยง

sourceยง

impl<Storage> BitfieldUnit<Storage>

source

pub const fn new(storage: Storage) -> Self

sourceยง

impl<Storage> BitfieldUnit<Storage>where Storage: AsRef<[u8]> + AsMut<[u8]>,

source

pub fn get_bit(&self, index: usize) -> bool

source

pub fn set_bit(&mut self, index: usize, val: bool)

source

pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64

source

pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64)

Trait Implementationsยง

sourceยง

impl<Storage: Clone> Clone for BitfieldUnit<Storage>

sourceยง

fn clone(&self) -> BitfieldUnit<Storage>

Returns a copy 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<Storage: Debug> Debug for BitfieldUnit<Storage>

sourceยง

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

Formats the value using the given formatter. Read more
sourceยง

impl<Storage: Default> Default for BitfieldUnit<Storage>

sourceยง

fn default() -> BitfieldUnit<Storage>

Returns the โ€œdefault valueโ€ for a type. Read more
sourceยง

impl<Storage: Hash> Hash for BitfieldUnit<Storage>

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<Storage: Ord> Ord for BitfieldUnit<Storage>

sourceยง

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

This method returns an Ordering between self and other. Read more
1.21.0 ยท sourceยง

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

Compares and returns the maximum of two values. Read more
1.21.0 ยท sourceยง

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

Compares and returns the minimum of two values. Read more
1.50.0 ยท sourceยง

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
sourceยง

impl<Storage: PartialEq> PartialEq<BitfieldUnit<Storage>> for BitfieldUnit<Storage>

sourceยง

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 ยท sourceยง

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
sourceยง

impl<Storage: PartialOrd> PartialOrd<BitfieldUnit<Storage>> for BitfieldUnit<Storage>

sourceยง

fn partial_cmp(&self, other: &BitfieldUnit<Storage>) -> 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

This method 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

This method 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

This method 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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
sourceยง

impl<Storage: Copy> Copy for BitfieldUnit<Storage>

sourceยง

impl<Storage: Eq> Eq for BitfieldUnit<Storage>

sourceยง

impl<Storage> StructuralEq for BitfieldUnit<Storage>

sourceยง

impl<Storage> StructuralPartialEq for BitfieldUnit<Storage>

Auto Trait Implementationsยง

ยง

impl<Storage> RefUnwindSafe for BitfieldUnit<Storage>where Storage: RefUnwindSafe,

ยง

impl<Storage> Send for BitfieldUnit<Storage>where Storage: Send,

ยง

impl<Storage> Sync for BitfieldUnit<Storage>where Storage: Sync,

ยง

impl<Storage> Unpin for BitfieldUnit<Storage>where Storage: Unpin,

ยง

impl<Storage> UnwindSafe for BitfieldUnit<Storage>where Storage: UnwindSafe,

Blanket Implementationsยง

sourceยง

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

sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
sourceยง

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

sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
sourceยง

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

ยง

type Owned = T

The resulting type after obtaining ownership.
sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
sourceยง

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

ยง

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 Twhere U: TryFrom<T>,

ยง

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.