[−][src]Struct bounded_registers::Field
A field in a register parameterized by its mask, offset, and upper
bound. To construct a field, its val
must be ⩽ U::U32
.
It uses these type-level numbers so that the mask and offset can be constant.
Methods
impl<W, M: Unsigned, O: Unsigned, U: Unsigned, R> Field<W, M, O, U, R> where
U: IsGreater<U0, Output = True> + ReifyTo<W>,
W: Copy + Clone + PartialOrd + BitAnd<W, Output = W> + Shr<W, Output = W> + Default,
U: ReifyTo<W>,
U0: ReifyTo<W>,
[src]
U: IsGreater<U0, Output = True> + ReifyTo<W>,
W: Copy + Clone + PartialOrd + BitAnd<W, Output = W> + Shr<W, Output = W> + Default,
U: ReifyTo<W>,
U0: ReifyTo<W>,
pub fn new(val: W) -> Option<Self>
[src]
New returns a Some(Field)
if the given value is less than or equal to
its upper bound, otherwise it returns None
.
pub fn set(self, val: W) -> Option<Self>
[src]
set
takes an existing field sets its value to val
. If val
is not ⩽ U
, it returns None
.
pub fn val(&self) -> W
[src]
val
retrieves the value from the field.
pub fn is_set(&self) -> bool
[src]
is_set
returns whether or not the field's val is equal to
its upper bound.
impl<M: Unsigned, O: Unsigned, U: Unsigned, R> Field<u8, M, O, U, R> where
U: IsGreater<U0, Output = True>,
[src]
U: IsGreater<U0, Output = True>,
pub const fn checked<V: Unsigned>() -> Self where
V: IsLessOrEqual<U, Output = True>,
V: IsGreaterOrEqual<U0, Output = True>,
[src]
V: IsLessOrEqual<U, Output = True>,
V: IsGreaterOrEqual<U0, Output = True>,
checked
is a compile-time checked constructor for a
Field
. Its V
parameter must be ⩽ U
; if it is not, the
program will fail to typecheck.
impl<M: Unsigned, O: Unsigned, U: Unsigned, R> Field<u16, M, O, U, R> where
U: IsGreater<U0, Output = True>,
[src]
U: IsGreater<U0, Output = True>,
pub const fn checked<V: Unsigned>() -> Self where
V: IsLessOrEqual<U, Output = True>,
V: IsGreaterOrEqual<U0, Output = True>,
[src]
V: IsLessOrEqual<U, Output = True>,
V: IsGreaterOrEqual<U0, Output = True>,
checked
is a compile-time checked constructor for a
Field
. Its V
parameter must be ⩽ U
; if it is not, the
program will fail to typecheck.
impl<M: Unsigned, O: Unsigned, U: Unsigned, R> Field<u32, M, O, U, R> where
U: IsGreater<U0, Output = True>,
[src]
U: IsGreater<U0, Output = True>,
pub const fn checked<V: Unsigned>() -> Self where
V: IsLessOrEqual<U, Output = True>,
V: IsGreaterOrEqual<U0, Output = True>,
[src]
V: IsLessOrEqual<U, Output = True>,
V: IsGreaterOrEqual<U0, Output = True>,
checked
is a compile-time checked constructor for a
Field
. Its V
parameter must be ⩽ U
; if it is not, the
program will fail to typecheck.
impl<M: Unsigned, O: Unsigned, U: Unsigned, R> Field<u64, M, O, U, R> where
U: IsGreater<U0, Output = True>,
[src]
U: IsGreater<U0, Output = True>,
pub const fn checked<V: Unsigned>() -> Self where
V: IsLessOrEqual<U, Output = True>,
V: IsGreaterOrEqual<U0, Output = True>,
[src]
V: IsLessOrEqual<U, Output = True>,
V: IsGreaterOrEqual<U0, Output = True>,
checked
is a compile-time checked constructor for a
Field
. Its V
parameter must be ⩽ U
; if it is not, the
program will fail to typecheck.
impl<M: Unsigned, O: Unsigned, U: Unsigned, R> Field<usize, M, O, U, R> where
U: IsGreater<U0, Output = True>,
[src]
U: IsGreater<U0, Output = True>,
pub const fn checked<V: Unsigned>() -> Self where
V: IsLessOrEqual<U, Output = True>,
V: IsGreaterOrEqual<U0, Output = True>,
[src]
V: IsLessOrEqual<U, Output = True>,
V: IsGreaterOrEqual<U0, Output = True>,
checked
is a compile-time checked constructor for a
Field
. Its V
parameter must be ⩽ U
; if it is not, the
program will fail to typecheck.
Trait Implementations
impl<W, M: Unsigned, O: Unsigned, U: Unsigned, R> Positioned for Field<W, M, O, U, R> where
U: IsGreater<U0, Output = True> + ReifyTo<W>,
W: Copy + Clone + PartialOrd + BitAnd<W, Output = W> + Shr<W, Output = W> + Default + Shl<W, Output = W>,
M: ReifyTo<W>,
U0: ReifyTo<W>,
O: ReifyTo<W>,
[src]
U: IsGreater<U0, Output = True> + ReifyTo<W>,
W: Copy + Clone + PartialOrd + BitAnd<W, Output = W> + Shr<W, Output = W> + Default + Shl<W, Output = W>,
M: ReifyTo<W>,
U0: ReifyTo<W>,
O: ReifyTo<W>,
type Width = W
fn mask(&self) -> W
[src]
The mask for this positioned value.
fn in_position(&self) -> W
[src]
Presents a value as its register-relative value.
impl<W, M: Unsigned, O: Unsigned, U: Unsigned, R> PartialEq<Field<W, M, O, U, R>> for Field<W, M, O, U, R> where
U: IsGreater<U0, Output = True> + ReifyTo<W>,
W: Copy + Clone + PartialOrd + BitAnd<W, Output = W> + Shr<W, Output = W> + Default,
U0: ReifyTo<W>,
[src]
U: IsGreater<U0, Output = True> + ReifyTo<W>,
W: Copy + Clone + PartialOrd + BitAnd<W, Output = W> + Shr<W, Output = W> + Default,
U0: ReifyTo<W>,
fn eq(&self, rhs: &Field<W, M, O, U, R>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<W, LM: Unsigned, LO: Unsigned, LU: Unsigned, LR, RM: Unsigned, RO: Unsigned, RU: Unsigned, RR> Add<Field<W, RM, RO, RU, RR>> for Field<W, LM, LO, LU, LR> where
LU: IsGreater<U0, Output = True> + ReifyTo<W>,
RU: IsGreater<U0, Output = True> + ReifyTo<W>,
RO: ReifyTo<W>,
LO: ReifyTo<W>,
W: Copy + Clone + PartialOrd + BitAnd<W, Output = W> + Shr<W, Output = W> + Default + Shl<W, Output = W> + BitOr<W, Output = W>,
U0: ReifyTo<W>,
LM: BitOr<RM>,
<LM as BitOr<RM>>::Output: ReifyTo<W>,
[src]
LU: IsGreater<U0, Output = True> + ReifyTo<W>,
RU: IsGreater<U0, Output = True> + ReifyTo<W>,
RO: ReifyTo<W>,
LO: ReifyTo<W>,
W: Copy + Clone + PartialOrd + BitAnd<W, Output = W> + Shr<W, Output = W> + Default + Shl<W, Output = W> + BitOr<W, Output = W>,
U0: ReifyTo<W>,
LM: BitOr<RM>,
<LM as BitOr<RM>>::Output: ReifyTo<W>,
type Output = FieldDisj<W>
The resulting type after applying the +
operator.
fn add(self, rhs: Field<W, RM, RO, RU, RR>) -> Self::Output
[src]
impl<W, M: Unsigned, O: Unsigned, U: Unsigned, R> Add<FieldDisj<W>> for Field<W, M, O, U, R> where
U: IsGreater<U0, Output = True> + ReifyTo<W>,
W: Copy + Clone + PartialOrd + BitAnd<W, Output = W> + Shr<W, Output = W> + Default + Shl<W, Output = W> + BitOr<W, Output = W>,
U0: ReifyTo<W>,
O: ReifyTo<W>,
M: ReifyTo<W>,
[src]
U: IsGreater<U0, Output = True> + ReifyTo<W>,
W: Copy + Clone + PartialOrd + BitAnd<W, Output = W> + Shr<W, Output = W> + Default + Shl<W, Output = W> + BitOr<W, Output = W>,
U0: ReifyTo<W>,
O: ReifyTo<W>,
M: ReifyTo<W>,
type Output = FieldDisj<W>
The resulting type after applying the +
operator.
fn add(self, rhs: FieldDisj<W>) -> Self::Output
[src]
impl<W, M: Unsigned, O: Unsigned, U: Unsigned, R> Add<Field<W, M, O, U, R>> for FieldDisj<W> where
U: IsGreater<U0, Output = True> + ReifyTo<W>,
W: Copy + Clone + PartialOrd + BitAnd<W, Output = W> + Shr<W, Output = W> + Default + Shl<W, Output = W> + BitOr<W, Output = W>,
U0: ReifyTo<W>,
O: ReifyTo<W>,
M: ReifyTo<W>,
[src]
U: IsGreater<U0, Output = True> + ReifyTo<W>,
W: Copy + Clone + PartialOrd + BitAnd<W, Output = W> + Shr<W, Output = W> + Default + Shl<W, Output = W> + BitOr<W, Output = W>,
U0: ReifyTo<W>,
O: ReifyTo<W>,
M: ReifyTo<W>,
type Output = FieldDisj<W>
The resulting type after applying the +
operator.
fn add(self, rhs: Field<W, M, O, U, R>) -> Self::Output
[src]
impl<W: Debug, M: Debug, O: Debug, U: Debug, R: Debug> Debug for Field<W, M, O, U, R> where
U: IsGreater<U0, Output = True>,
[src]
U: IsGreater<U0, Output = True>,
Auto Trait Implementations
impl<W, M, O, U, R> Unpin for Field<W, M, O, U, R> where
M: Unpin,
O: Unpin,
R: Unpin,
U: Unpin,
W: Unpin,
M: Unpin,
O: Unpin,
R: Unpin,
U: Unpin,
W: Unpin,
impl<W, M, O, U, R> Send for Field<W, M, O, U, R> where
M: Send,
O: Send,
R: Send,
U: Send,
W: Send,
M: Send,
O: Send,
R: Send,
U: Send,
W: Send,
impl<W, M, O, U, R> Sync for Field<W, M, O, U, R> where
M: Sync,
O: Sync,
R: Sync,
U: Sync,
W: Sync,
M: Sync,
O: Sync,
R: Sync,
U: Sync,
W: Sync,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self