[][src]Struct bounded_registers::bounds::Bounded

pub struct Bounded<N, L, U> {
    pub val: N,
    // some fields omitted
}

A type whose behaviors enforce that its val member fall with in the range prescribed by L (a lower bound) and U (an upper bound).

Fields

val: N

Methods

impl<N, L, U> Bounded<N, L, U> where
    N: Clone + Copy + PartialOrd,
    L: ReifyTo<N>,
    U: ReifyTo<N>,
    U: IsGreater<L, Output = True>, 
[src]

pub fn new(val: N) -> Option<Self>[src]

Make a new instance of a bounded value. If L <= val <= U does not hold, then new returns None.

impl<L, U> Bounded<u8, L, U>[src]

pub const fn checked<V: Unsigned>() -> Self where
    V: IsLessOrEqual<U, Output = True>,
    V: IsGreaterOrEqual<L, Output = True>, 
[src]

Compile-type checked value.

impl<L, U> Bounded<u16, L, U>[src]

pub const fn checked<V: Unsigned>() -> Self where
    V: IsLessOrEqual<U, Output = True>,
    V: IsGreaterOrEqual<L, Output = True>, 
[src]

Compile-type checked value.

impl<L, U> Bounded<u32, L, U>[src]

pub const fn checked<V: Unsigned>() -> Self where
    V: IsLessOrEqual<U, Output = True>,
    V: IsGreaterOrEqual<L, Output = True>, 
[src]

Compile-type checked value.

impl<L, U> Bounded<u64, L, U>[src]

pub const fn checked<V: Unsigned>() -> Self where
    V: IsLessOrEqual<U, Output = True>,
    V: IsGreaterOrEqual<L, Output = True>, 
[src]

Compile-type checked value.

impl<L, U> Bounded<usize, L, U>[src]

pub const fn checked<V: Unsigned>() -> Self where
    V: IsLessOrEqual<U, Output = True>,
    V: IsGreaterOrEqual<L, Output = True>, 
[src]

Compile-type checked value.

Trait Implementations

impl<N: Debug, L: Debug, U: Debug> Debug for Bounded<N, L, U>[src]

impl<N: Copy, L: Copy, U: Copy> Copy for Bounded<N, L, U>[src]

impl<N: Clone, L: Clone, U: Clone> Clone for Bounded<N, L, U>[src]

Auto Trait Implementations

impl<N, L, U> Unpin for Bounded<N, L, U> where
    L: Unpin,
    N: Unpin,
    U: Unpin

impl<N, L, U> Send for Bounded<N, L, U> where
    L: Send,
    N: Send,
    U: Send

impl<N, L, U> Sync for Bounded<N, L, U> where
    L: Sync,
    N: Sync,
    U: Sync

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self