[][src]Struct modtype::u64::field::F

pub struct F { /* fields omitted */ }

A modular arithmetic integer type.

Example

use modtype::u64::field::F;

let runtime_mod = 7;
#[allow(non_snake_case)]
let F = F::factory(runtime_mod);

assert_eq!(F(6) + F(1), F(0));

Methods

impl F[src]

pub fn new(value: u64, modulus: u64) -> Self[src]

Constructs a new F.

pub const fn new_unchecked(value: u64, modulus: u64) -> Self[src]

Constructs a new F without checking the value.

pub fn factory(modulus: u64) -> impl Fn(u64) -> Self[src]

Same as move |n| Self::new(n, modulus).

pub const fn get(self) -> u64[src]

Gets the inner value.

Trait Implementations

impl PartialOrd<F> for F[src]

impl PartialEq<F> for F[src]

impl Copy for F[src]

impl Ord for F[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 Eq for F[src]

impl From<F> for u64[src]

impl Clone for F[src]

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

Performs copy-assignment from source. Read more

impl Deref for F[src]

type Target = u64

The resulting type after dereferencing.

impl Add<F> for F[src]

type Output = F

The resulting type after applying the + operator.

impl<'_> Add<F> for &'_ F[src]

type Output = F

The resulting type after applying the + operator.

impl<'_> Add<&'_ F> for F[src]

type Output = F

The resulting type after applying the + operator.

impl<'_, '_> Add<&'_ F> for &'_ F[src]

type Output = F

The resulting type after applying the + operator.

impl Sub<F> for F[src]

type Output = F

The resulting type after applying the - operator.

impl<'_> Sub<F> for &'_ F[src]

type Output = F

The resulting type after applying the - operator.

impl<'_> Sub<&'_ F> for F[src]

type Output = F

The resulting type after applying the - operator.

impl<'_, '_> Sub<&'_ F> for &'_ F[src]

type Output = F

The resulting type after applying the - operator.

impl Mul<F> for F[src]

type Output = F

The resulting type after applying the * operator.

impl<'_> Mul<F> for &'_ F[src]

type Output = F

The resulting type after applying the * operator.

impl<'_> Mul<&'_ F> for F[src]

type Output = F

The resulting type after applying the * operator.

impl<'_, '_> Mul<&'_ F> for &'_ F[src]

type Output = F

The resulting type after applying the * operator.

impl Div<F> for F[src]

type Output = F

The resulting type after applying the / operator.

impl<'_> Div<F> for &'_ F[src]

type Output = F

The resulting type after applying the / operator.

impl<'_> Div<&'_ F> for F[src]

type Output = F

The resulting type after applying the / operator.

impl<'_, '_> Div<&'_ F> for &'_ F[src]

type Output = F

The resulting type after applying the / operator.

impl Rem<F> for F[src]

type Output = F

The resulting type after applying the % operator.

impl<'_> Rem<F> for &'_ F[src]

type Output = F

The resulting type after applying the % operator.

impl<'_> Rem<&'_ F> for F[src]

type Output = F

The resulting type after applying the % operator.

impl<'_, '_> Rem<&'_ F> for &'_ F[src]

type Output = F

The resulting type after applying the % operator.

impl Neg for F[src]

type Output = F

The resulting type after applying the - operator.

impl<'_> Neg for &'_ F[src]

type Output = F

The resulting type after applying the - operator.

impl AddAssign<F> for F[src]

impl<'_> AddAssign<&'_ F> for F[src]

impl SubAssign<F> for F[src]

impl<'_> SubAssign<&'_ F> for F[src]

impl MulAssign<F> for F[src]

impl<'_> MulAssign<&'_ F> for F[src]

impl DivAssign<F> for F[src]

impl<'_> DivAssign<&'_ F> for F[src]

impl RemAssign<F> for F[src]

impl<'_> RemAssign<&'_ F> for F[src]

impl Debug for F[src]

impl Display for F[src]

impl CheckedMul for F[src]

impl Inv for F[src]

type Output = F

The result after applying the operator.

impl<'_> Inv for &'_ F[src]

type Output = F

The result after applying the operator.

impl CheckedNeg for F[src]

impl CheckedAdd for F[src]

impl CheckedSub for F[src]

impl CheckedDiv for F[src]

impl CheckedRem for F[src]

impl Pow<u8> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<&'_ u8> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<u8> for &'_ F[src]

type Output = F

The result after applying the operator.

impl<'_, '_> Pow<&'_ u8> for &'_ F[src]

type Output = F

The result after applying the operator.

impl Pow<u16> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<&'_ u16> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<u16> for &'_ F[src]

type Output = F

The result after applying the operator.

impl<'_, '_> Pow<&'_ u16> for &'_ F[src]

type Output = F

The result after applying the operator.

impl Pow<u32> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<&'_ u32> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<u32> for &'_ F[src]

type Output = F

The result after applying the operator.

impl<'_, '_> Pow<&'_ u32> for &'_ F[src]

type Output = F

The result after applying the operator.

impl Pow<u64> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<&'_ u64> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<u64> for &'_ F[src]

type Output = F

The result after applying the operator.

impl<'_, '_> Pow<&'_ u64> for &'_ F[src]

type Output = F

The result after applying the operator.

impl Pow<u128> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<&'_ u128> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<u128> for &'_ F[src]

type Output = F

The result after applying the operator.

impl<'_, '_> Pow<&'_ u128> for &'_ F[src]

type Output = F

The result after applying the operator.

impl Pow<usize> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<&'_ usize> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<usize> for &'_ F[src]

type Output = F

The result after applying the operator.

impl<'_, '_> Pow<&'_ usize> for &'_ F[src]

type Output = F

The result after applying the operator.

impl Pow<i8> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<&'_ i8> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<i8> for &'_ F[src]

type Output = F

The result after applying the operator.

impl<'_, '_> Pow<&'_ i8> for &'_ F[src]

type Output = F

The result after applying the operator.

impl Pow<i16> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<&'_ i16> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<i16> for &'_ F[src]

type Output = F

The result after applying the operator.

impl<'_, '_> Pow<&'_ i16> for &'_ F[src]

type Output = F

The result after applying the operator.

impl Pow<i32> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<&'_ i32> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<i32> for &'_ F[src]

type Output = F

The result after applying the operator.

impl<'_, '_> Pow<&'_ i32> for &'_ F[src]

type Output = F

The result after applying the operator.

impl Pow<i64> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<&'_ i64> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<i64> for &'_ F[src]

type Output = F

The result after applying the operator.

impl<'_, '_> Pow<&'_ i64> for &'_ F[src]

type Output = F

The result after applying the operator.

impl Pow<i128> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<&'_ i128> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<i128> for &'_ F[src]

type Output = F

The result after applying the operator.

impl<'_, '_> Pow<&'_ i128> for &'_ F[src]

type Output = F

The result after applying the operator.

impl Pow<isize> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<&'_ isize> for F[src]

type Output = F

The result after applying the operator.

impl<'_> Pow<isize> for &'_ F[src]

type Output = F

The result after applying the operator.

impl<'_, '_> Pow<&'_ isize> for &'_ F[src]

type Output = F

The result after applying the operator.

Auto Trait Implementations

impl Send for F

impl Unpin for F

impl Sync for F

impl UnwindSafe for F

impl RefUnwindSafe for F

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, 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, Base> RefNum<Base> for T where
    T: NumOps<Base, Base> + NumOps<&'r Base, Base>, 
[src]