pub struct FieldValue<T, R>where
    T: UIntLike,
    R: RegisterLongName,{
    pub value: T,
    /* private fields */
}
Expand description

Values for the specific register fields.

For the FieldValue, the masks and values are shifted into their actual location in the register.

Fields§

§value: T

Implementations§

source§

impl<R> FieldValue<u8, R>where R: RegisterLongName,

source

pub const fn new(mask: u8, shift: usize, value: u8) -> FieldValue<u8, R>

source§

impl<R> FieldValue<u16, R>where R: RegisterLongName,

source

pub const fn new(mask: u16, shift: usize, value: u16) -> FieldValue<u16, R>

source§

impl<R> FieldValue<u32, R>where R: RegisterLongName,

source

pub const fn new(mask: u32, shift: usize, value: u32) -> FieldValue<u32, R>

source§

impl<R> FieldValue<u64, R>where R: RegisterLongName,

source

pub const fn new(mask: u64, shift: usize, value: u64) -> FieldValue<u64, R>

source§

impl<R> FieldValue<u128, R>where R: RegisterLongName,

source

pub const fn new(mask: u128, shift: usize, value: u128) -> FieldValue<u128, R>

source§

impl<R> FieldValue<usize, R>where R: RegisterLongName,

source

pub const fn new( mask: usize, shift: usize, value: usize ) -> FieldValue<usize, R>

source§

impl<T, R> FieldValue<T, R>where T: UIntLike, R: RegisterLongName,

source

pub fn none() -> FieldValue<T, R>

source

pub const fn mask(&self) -> T

Get the raw bitmask represented by this FieldValue.

source

pub fn read(&self, field: Field<T, R>) -> T

source

pub fn modify(self, val: T) -> T

Modify fields in a register value

source

pub fn any_matching_bits_set(&self, val: T) -> bool

Check if any of the bits covered by the mask for this FieldValue and set in the FieldValue are also set in the passed value

source

pub fn matches_all(&self, val: T) -> bool

Check if all specified parts of a field match

Trait Implementations§

source§

impl<T, R> Add<FieldValue<T, R>> for FieldValue<T, R>where T: UIntLike, R: RegisterLongName,

§

type Output = FieldValue<T, R>

The resulting type after applying the + operator.
source§

fn add(self, rhs: FieldValue<T, R>) -> FieldValue<T, R>

Performs the + operation. Read more
source§

impl<T, R> AddAssign<FieldValue<T, R>> for FieldValue<T, R>where T: UIntLike, R: RegisterLongName,

source§

fn add_assign(&mut self, rhs: FieldValue<T, R>)

Performs the += operation. Read more
source§

impl<T, R> Clone for FieldValue<T, R>where T: Clone + UIntLike, R: Clone + RegisterLongName,

source§

fn clone(&self) -> FieldValue<T, R>

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<T, R> Copy for FieldValue<T, R>where T: Copy + UIntLike, R: Copy + RegisterLongName,

Auto Trait Implementations§

§

impl<T, R> RefUnwindSafe for FieldValue<T, R>where R: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, R> Send for FieldValue<T, R>where R: Send, T: Send,

§

impl<T, R> Sync for FieldValue<T, R>where R: Sync, T: Sync,

§

impl<T, R> Unpin for FieldValue<T, R>where R: Unpin, T: Unpin,

§

impl<T, R> UnwindSafe for FieldValue<T, R>where R: UnwindSafe, T: 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> SizedTypeProperties for T

source§

const IS_ZST: bool = size_of::<Self>() == 0

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. 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.