[][src]Struct modtype::ModType

pub struct ModType<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> { /* fields omitted */ }

A modular arithmetic integer type which modulus is a constant.

Examples

use modtype::{use_modtype, DefaultModType};
use num::bigint::{Sign, ToBigInt as _, ToBigUint as _};
use num::pow::Pow as _;
use num::traits::{CheckedNeg as _, CheckedRem as _, Inv as _};
use num::{
    BigInt, BigUint, Bounded as _, CheckedAdd as _, CheckedDiv as _, CheckedMul as _,
    CheckedSub as _, FromPrimitive as _, Num as _, One as _, ToPrimitive as _, Unsigned,
    Zero as _,
};

#[use_modtype]
type F = DefaultModType<7u32>;

fn static_assert_unsigned<T: Unsigned>() {}

// Constructor, `new`, `new_unchecked`, `get`
assert_eq!(F::new(8), F(1));
assert_ne!(F::new_unchecked(8), F(1));
assert_eq!(F(3).get(), 3u32);

// `From<{T, BigUint, BigInt}>`
assert_eq!(F::from(3), F(3));
assert_eq!(F::from(BigUint::new(vec![3])), F(3));
assert_eq!(F::from(BigInt::new(Sign::Minus, vec![4])), F(3));

// `Display`, `Debug`
assert_eq!(F(3).to_string(), "3");
assert_eq!(format!("{:?}", F(3)), "3");

// `FromStr`
assert_eq!("3".parse::<F>(), Ok(F(3)));

// `Deref`
assert_eq!(*F(3), 3);
assert_eq!(F(3).to_i64(), Some(3i64));
assert_eq!(F(3).to_biguint(), 3u64.to_biguint());
assert_eq!(F(3).to_bigint(), 3u64.to_bigint());

// `Neg`
assert_eq!(-F(1), F(6));

// `Add`, `Sub`, `Mul`, `Div`, `Rem`
assert_eq!(F(3) + F(4), F(0));
assert_eq!(F(3) - F(4), F(6));
assert_eq!(F(3) * F(4), F(5));
assert_eq!(F(3) / F(4), F(6));
(0..=6).for_each(|x| (1..=6).for_each(|y| assert_eq!(F(x) % F(y), F(0))));

// `Num`
assert_eq!(F::from_str_radix("111", 2), Ok(F(0)));

// `Unsigned`
static_assert_unsigned::<F>();

// `Bounded`
assert_eq!((F::min_value(), F::max_value()), (F(0), F(6)));

// `Zero`, `One`
assert_eq!(F::zero(), F(0));
assert_eq!(F::one(), F(1));

// `FromPrimitive`
assert_eq!(F::from_i128(-1), Some(-F(1)));
assert_eq!(F::from_f64(0.5), Some(F(1) / F(2)));

// `Inv`
assert_eq!(F(3).inv(), F(5));

// `CheckedNeg`
(0..=6).for_each(|x| assert!(F(x).checked_neg().is_some()));

// `CheckedAdd`, `CheckedSub`, `CheckedMul`, `CheckedDiv`, `CheckedRem`
(0..=6).for_each(|x| (0..=6).for_each(|y| assert!(F(x).checked_add(&F(y)).is_some())));
assert_eq!(
    num::range_step(F(0), F(6), F(2)).collect::<Vec<_>>(),
    &[F(0), F(2), F(4)],
);
(0..=6).for_each(|x| (0..=6).for_each(|y| assert!(F(x).checked_sub(&F(y)).is_some())));
(0..=6).for_each(|x| (0..=6).for_each(|y| assert!(F(x).checked_mul(&F(y)).is_some())));
(0..=6).for_each(|x| (1..=6).for_each(|y| assert!(F(x).checked_div(&F(y)).is_some())));
(0..=6).for_each(|x| assert!(F(x).checked_div(&F(0)).is_none()));
(0..=6).for_each(|x| (1..=6).for_each(|y| assert!(F(x).checked_rem(&F(y)).is_some())));
(0..=6).for_each(|x| assert!(F(x).checked_rem(&F(0)).is_none()));

// `Pow`
assert_eq!(F(3).pow(2u8), F(2));
assert_eq!(F(3).pow(2u16), F(2));
assert_eq!(F(3).pow(2u32), F(2));
assert_eq!(F(3).pow(2u64), F(2));
assert_eq!(F(3).pow(2u128), F(2));
assert_eq!(F(3).pow(2usize), F(2));
assert_eq!(F(3).pow(-2i8), F(4));
assert_eq!(F(3).pow(-2i16), F(4));
assert_eq!(F(3).pow(-2i32), F(4));
assert_eq!(F(3).pow(-2i64), F(4));
assert_eq!(F(3).pow(-2i128), F(4));
assert_eq!(F(3).pow(-2isize), F(4));

Methods

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> ModType<T, C, M>[src]

pub fn modulus() -> T[src]

Gets the modulus.

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

Creates a new ModType.

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

Creates a new ModType without checking value.

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

Gets the inner value.

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

Returns a mutable reference to the inner value.

Trait Implementations

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> PartialOrd<ModType<T, C, M>> for ModType<T, C, M>[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> PartialEq<ModType<T, C, M>> for ModType<T, C, M>[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Copy for ModType<T, C, M>[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Ord for ModType<T, C, M>[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Eq for ModType<T, C, M>[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Default for ModType<T, C, M>[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> From<T> for ModType<T, C, M>[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> From<BigUint> for ModType<T, C, M>[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> From<BigInt> for ModType<T, C, M>[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Clone for ModType<T, C, M>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Deref for ModType<T, C, M>[src]

type Target = T

The resulting type after dereferencing.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Add<ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Addition = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the + operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Add<&'_ ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Addition = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the + operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Add<ModType<T, C, M>> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Addition = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the + operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Add<&'_ ModType<T, C, M>> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Addition = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the + operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Sub<ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Subtraction = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the - operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Sub<&'_ ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Subtraction = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the - operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Sub<ModType<T, C, M>> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Subtraction = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the - operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Sub<&'_ ModType<T, C, M>> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Subtraction = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the - operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Mul<ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the * operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Mul<&'_ ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the * operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Mul<ModType<T, C, M>> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the * operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Mul<&'_ ModType<T, C, M>> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the * operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Div<ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the / operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Div<&'_ ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the / operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Div<ModType<T, C, M>> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the / operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Div<&'_ ModType<T, C, M>> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the / operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Rem<ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the % operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Rem<&'_ ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the % operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Rem<ModType<T, C, M>> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the % operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Rem<&'_ ModType<T, C, M>> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the % operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Neg for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Subtraction = True>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Neg for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Subtraction = True>, 
[src]

type Output = ModType<T, C, M>

The resulting type after applying the - operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> AddAssign<ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Addition = True>, 
[src]

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> AddAssign<&'_ ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Addition = True>, 
[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> SubAssign<ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Subtraction = True>, 
[src]

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> SubAssign<&'_ ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Subtraction = True>, 
[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> MulAssign<ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> MulAssign<&'_ ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> DivAssign<ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> DivAssign<&'_ ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> RemAssign<ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> RemAssign<&'_ ModType<T, C, M>> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Debug for ModType<T, C, M>[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Display for ModType<T, C, M>[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> FromStr for ModType<T, C, M>[src]

type Err = ParseIntError

The associated error which can be returned from parsing.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> CheckedMul for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Zero for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Addition = True>, 
[src]

fn set_zero(&mut self)[src]

Sets self to the additive identity element of Self, 0.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> One for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

fn set_one(&mut self)[src]

Sets self to the multiplicative identity element of Self, 1.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> FromPrimitive for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Subtraction = True, Multiplication = True, Division = True>, 
[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Inv for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Inv for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> CheckedNeg for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Subtraction = True>, 
[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> CheckedAdd for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Addition = True>, 
[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> CheckedSub for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Subtraction = True>, 
[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> CheckedDiv for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> CheckedRem for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<u8> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ u8> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<u8> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ u8> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<u16> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ u16> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<u16> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ u16> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<u32> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ u32> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<u32> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ u32> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<u64> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ u64> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<u64> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ u64> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<u128> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ u128> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<u128> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ u128> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<usize> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ usize> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<usize> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ usize> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<i8> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ i8> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<i8> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ i8> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<i16> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ i16> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<i16> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ i16> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<i32> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ i32> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<i32> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ i32> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<i64> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ i64> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<i64> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ i64> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<i128> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ i128> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<i128> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ i128> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<isize> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ isize> for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = Self

The result after applying the operator.

impl<'_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<isize> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<'_, '_, T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Pow<&'_ isize> for &'_ ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Multiplication = True>,
    <C as Cartridge>::Features: Features<Division = True>, 
[src]

type Output = ModType<T, C, M>

The result after applying the operator.

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Bounded for ModType<T, C, M>[src]

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Num for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Addition = True, Subtraction = True, Multiplication = True, Division = True>, 
[src]

type FromStrRadixErr = ParseIntError

impl<T: UnsignedPrimitive, C: Cartridge<Target = T>, M: ConstValue<Value = T>> Unsigned for ModType<T, C, M> where
    <C as Cartridge>::Features: Features<Addition = True, Subtraction = True, Multiplication = True, Division = True>, 
[src]

Auto Trait Implementations

impl<T, C, M> Send for ModType<T, C, M>

impl<T, C, M> Unpin for ModType<T, C, M> where
    T: Unpin

impl<T, C, M> Sync for ModType<T, C, M>

impl<T, C, M> UnwindSafe for ModType<T, C, M> where
    T: UnwindSafe

impl<T, C, M> RefUnwindSafe for ModType<T, C, M> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> Into<U> for T where
    U: From<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> 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> NumRef for T where
    T: Num + NumOps<&'r T, T>, 
[src]

impl<T, Rhs> NumAssignOps<Rhs> for T where
    T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, 
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T> NumAssignRef for T where
    T: NumAssign + NumAssignOps<&'r T>, 
[src]

impl<T, Base> RefNum<Base> for T where
    T: NumOps<Base, Base> + NumOps<&'r Base, Base>, 
[src]

impl<T> NumAssign for T where
    T: Num + NumAssignOps<T>, 
[src]