pub struct RegisterBits<R: Register> {
    mask: R::T,
    _phantom: PhantomData<R>,
}
Expand description

Represents a set of bits within a specific register.

Fields§

§mask: R::T

The raw bitmask.

§_phantom: PhantomData<R>

Implementations§

source§

impl<R> RegisterBits<R>where
R: Register,

source

pub const fn new(mask: R::T) -> Self

Creates a new register mask.

source

pub fn zero() -> Self

Trait Implementations§

source§

impl<R> BitAnd<RegisterBits<R>> for RegisterBits<R>where
R: Register,

§

type Output = RegisterBits<R>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self

Performs the & operation. Read more
source§

impl<R> BitAndAssign<RegisterBits<R>> for RegisterBits<R>where
R: Register,

source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
source§

impl<R> BitOr<RegisterBits<R>> for RegisterBits<R>where
R: Register,

§

type Output = RegisterBits<R>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self

Performs the | operation. Read more
source§

impl<R> BitOrAssign<RegisterBits<R>> for RegisterBits<R>where
R: Register,

source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
source§

impl<R: Clone + Register> Clone for RegisterBits<R>where
R::T: Clone,

source§

fn clone(&self) -> RegisterBits<R>

Returns a copy of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
source§

impl<R: Debug + Register> Debug for RegisterBits<R>where
R::T: Debug,

source§

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

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

impl<R> From<RegisterBits<R>> for u16where
R: Register<T = u16>,

source§

fn from(other: RegisterBits<R>) -> u16

Converts to this type from the input type.
source§

impl<R> From<RegisterBits<R>> for u8where
R: Register<T = u8>,

source§

fn from(other: RegisterBits<R>) -> u8

Converts to this type from the input type.
source§

impl<R: Hash + Register> Hash for RegisterBits<R>where
R::T: Hash,

source§

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

Feeds this value into the given [Hasher]. Read more
1.3.0§

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<R> Not for RegisterBits<R>where
R: Register,

§

type Output = RegisterBits<R>

The resulting type after applying the ! operator.
source§

fn not(self) -> Self

Performs the unary ! operation. Read more
source§

impl<R: Ord + Register> Ord for RegisterBits<R>where
R::T: Ord,

source§

fn cmp(&self, other: &RegisterBits<R>) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

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

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

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

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

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

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

impl<R: PartialEq + Register> PartialEq<RegisterBits<R>> for RegisterBits<R>where
R::T: PartialEq,

source§

fn eq(&self, other: &RegisterBits<R>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0§

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<R: PartialOrd + Register> PartialOrd<RegisterBits<R>> for RegisterBits<R>where
R::T: PartialOrd,

source§

fn partial_cmp(&self, other: &RegisterBits<R>) -> Option<Ordering>

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

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§

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§

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§

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<R: Copy + Register> Copy for RegisterBits<R>where
R::T: Copy,

source§

impl<R: Eq + Register> Eq for RegisterBits<R>where
R::T: Eq,

source§

impl<R: Register> StructuralEq for RegisterBits<R>

source§

impl<R: Register> StructuralPartialEq for RegisterBits<R>

Auto Trait Implementations§

§

impl<R> RefUnwindSafe for RegisterBits<R>where
R: RefUnwindSafe,
<R as Register>::T: RefUnwindSafe,

§

impl<R> Send for RegisterBits<R>where
R: Send,
<R as Register>::T: Send,

§

impl<R> Sync for RegisterBits<R>where
R: Sync,
<R as Register>::T: Sync,

§

impl<R> Unpin for RegisterBits<R>where
R: Unpin,
<R as Register>::T: Unpin,

§

impl<R> UnwindSafe for RegisterBits<R>where
R: UnwindSafe,
<R as Register>::T: UnwindSafe,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

const: unstable§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

const: unstable§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

const: unstable§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

const: unstable§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable§

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

Performs the conversion.
§

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.
const: unstable§

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

Performs the conversion.