Struct safe_modular_arithmetic::Modular [−][src]
Represents an integer with an associated modulus.
Implementations
impl<T: Clone + Eq + Rem<Output = T>> Modular<T>
[src]
pub fn new(value: T, modulus: T) -> Self
[src]
Constructs a new modular arithmetic integer.
pub fn value(&self) -> &T
[src]
Gets the value of the integer.
pub fn modulus(&self) -> &T
[src]
Gets the modulus of the integer.
pub fn into_parts(self) -> (T, T)
[src]
Splits the integer into its value and modulus.
Trait Implementations
impl<T: CheckedAdd + Clone + Eq + Rem<Output = T> + Shr<Output = T> + BitAnd<Output = T> + One> Add<Modular<T>> for Modular<T>
[src]
type Output = Modular<<T as Add>::Output>
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self::Output
[src]
impl<T: Clone + Eq + Rem<Output = T>> Clone for Modular<T>
[src]
impl<T: Copy + Clone + Eq + Rem<Output = T>> Copy for Modular<T>
[src]
impl<T: Eq + Clone + Rem<Output = T>> Eq for Modular<T>
[src]
impl<T: Clone + Eq + Rem<Output = T> + Sub<Output = T> + One> Neg for Modular<T>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl<T: PartialEq + Clone + Eq + Rem<Output = T>> PartialEq<Modular<T>> for Modular<T>
[src]
impl<T: Clone + Eq + Rem<Output = T>> StructuralEq for Modular<T>
[src]
impl<T: Clone + Eq + Rem<Output = T>> StructuralPartialEq for Modular<T>
[src]
impl<T: CheckedAdd + Clone + Eq + Rem<Output = T> + Sub<Output = T> + Shr<Output = T> + BitAnd<Output = T> + One> Sub<Modular<T>> for Modular<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Modular<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Modular<T> where
T: Send,
T: Send,
impl<T> Sync for Modular<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Modular<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Modular<T> 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<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut 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.
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>,