Struct safe_modular_arithmetic::StaticModular[][src]

pub struct StaticModular<T: Clone + Eq + Rem<Output = T> + One + From<usize>, const M: usize>(_);

Represents an integer with a statically specified modulus.

Implementations

impl<T: Clone + Eq + Rem<Output = T> + One + From<usize>, const M: usize> StaticModular<T, M>[src]

pub fn new(value: T) -> Self[src]

Constructs a new modular integer.

pub fn value(&self) -> &T[src]

Gets the value of the integer.

pub fn into_value(self) -> T[src]

Consumes the integer, producing its value.

pub fn into_dynamic(self) -> Modular<T>[src]

Consumes the integer, producing an equivalent Modular value.

Trait Implementations

impl<T: CheckedAdd + Clone + Eq + Rem<Output = T> + Shr<Output = T> + BitAnd<Output = T> + One + From<usize>, const M: usize> Add<StaticModular<T, M>> for StaticModular<T, M>[src]

type Output = StaticModular<<T as Add>::Output, M>

The resulting type after applying the + operator.

impl<T: Clone + Eq + Rem<Output = T> + One + From<usize>, const M: usize> Clone for StaticModular<T, M>[src]

impl<T: Copy + Clone + Eq + Rem<Output = T> + One + From<usize>, const M: usize> Copy for StaticModular<T, M>[src]

impl<T: Eq + Clone + Rem<Output = T> + One + From<usize>, const M: usize> Eq for StaticModular<T, M>[src]

impl<T: Clone + Eq + From<usize> + Rem<Output = T> + One, const M: usize> From<T> for StaticModular<T, M>[src]

impl<T: PartialEq + Clone + Eq + Rem<Output = T> + One + From<usize>, const M: usize> PartialEq<StaticModular<T, M>> for StaticModular<T, M>[src]

impl<T: Clone + Eq + Rem<Output = T> + One + From<usize>, const M: usize> StructuralEq for StaticModular<T, M>[src]

impl<T: Clone + Eq + Rem<Output = T> + One + From<usize>, const M: usize> StructuralPartialEq for StaticModular<T, M>[src]

Auto Trait Implementations

impl<T, const M: usize> RefUnwindSafe for StaticModular<T, M> where
    T: RefUnwindSafe

impl<T, const M: usize> Send for StaticModular<T, M> where
    T: Send

impl<T, const M: usize> Sync for StaticModular<T, M> where
    T: Sync

impl<T, const M: usize> Unpin for StaticModular<T, M> where
    T: Unpin

impl<T, const M: usize> UnwindSafe for StaticModular<T, M> where
    T: UnwindSafe

Blanket Implementations

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

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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> 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.