PrimeField

Trait PrimeField 

Source
pub trait PrimeField:
    PrimeFieldParams
    + SqrtField
    + FromStr
    + From<&'static str>
    + Borsh {
    // Required methods
    fn from_uint(v: Self::Inner) -> Option<Self>;
    fn from_mont_uint(v: Self::Inner) -> Option<Self>;
    fn from_uint_unchecked(v: Self::Inner) -> Self;
    fn from_mont_uint_unchecked(v: Self::Inner) -> Self;
    fn to_uint(&self) -> Self::Inner;
    fn to_mont_uint(&self) -> Self::Inner;
    fn as_mont_uint(&self) -> &Self::Inner;
    fn as_mont_uint_mut(&mut self) -> &mut Self::Inner;

    // Provided methods
    fn to_other<Fq: PrimeField>(&self) -> Option<Fq> { ... }
    fn to_other_reduced<Fq: PrimeField>(&self) -> Fq { ... }
}

Required Methods§

Source

fn from_uint(v: Self::Inner) -> Option<Self>

Source

fn from_mont_uint(v: Self::Inner) -> Option<Self>

Source

fn from_uint_unchecked(v: Self::Inner) -> Self

Source

fn from_mont_uint_unchecked(v: Self::Inner) -> Self

Source

fn to_uint(&self) -> Self::Inner

Source

fn to_mont_uint(&self) -> Self::Inner

Source

fn as_mont_uint(&self) -> &Self::Inner

Source

fn as_mont_uint_mut(&mut self) -> &mut Self::Inner

Provided Methods§

Source

fn to_other<Fq: PrimeField>(&self) -> Option<Fq>

Source

fn to_other_reduced<Fq: PrimeField>(&self) -> Fq

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§