[][src]Enum modtype::cartridges::AllowFlexibleRhs

pub enum AllowFlexibleRhs<C: Cartridge> {
    Infallible(InfalliblePhantomData<fn() -> C>),
}

Allows flexible RHSes.

use modtype::cartridges::{AllowFlexibleRhs, Field};
use num::{BigInt, BigRational};

#[modtype::use_modtype]
type F = modtype::ModType<AllowFlexibleRhs<Field<u64>>, 1_000_000_007u64>;

let mut x = F(1);
x += F(1);
x += 1u64;
x += 1i32;
x += 1f64;
x += BigInt::from(1u32);
x += BigRational::new(BigInt::from(1u32), BigInt::from(1u32));
assert_eq!(x, F(7));

Variants

Infallible(InfalliblePhantomData<fn() -> C>)

Trait Implementations

impl<C: Cartridge> Cartridge for AllowFlexibleRhs<C>[src]

type Target = C::Target

type AssumePrimeModulus = C::AssumePrimeModulus

type AssumeAlwaysAdjusted = C::AssumeAlwaysAdjusted

type Equality = C::Equality

type Order = C::Order

type Deref = C::Deref

type PartialAddition = C::PartialAddition

type PartialSubtraction = C::PartialSubtraction

type PartialMultiplication = C::PartialMultiplication

type PartialDivision = C::PartialDivision

type FlexibleRhs = True

Auto Trait Implementations

impl<C> Unpin for AllowFlexibleRhs<C>

impl<C> Sync for AllowFlexibleRhs<C>

impl<C> Send for AllowFlexibleRhs<C>

impl<C> RefUnwindSafe for AllowFlexibleRhs<C>

impl<C> UnwindSafe for AllowFlexibleRhs<C>

Blanket Implementations

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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