Struct safe_modular_arithmetic::StaticModular [−][src]
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.
fn add(self, rhs: Self) -> Self::Output
[src]
impl<T: Clone + Eq + From<usize> + Rem<Output = T> + One, const M: usize> From<T> for StaticModular<T, M>
[src]
Auto Trait Implementations
impl<T, const M: usize> RefUnwindSafe for StaticModular<T, M> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, const M: usize> Send for StaticModular<T, M> where
T: Send,
T: Send,
impl<T, const M: usize> Sync for StaticModular<T, M> where
T: Sync,
T: Sync,
impl<T, const M: usize> Unpin for StaticModular<T, M> where
T: Unpin,
T: Unpin,
impl<T, const M: usize> UnwindSafe for StaticModular<T, M> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
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.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,