Skip to main content

Field

Trait Field 

Source
pub trait Field:
    Sized
    + Clone
    + Copy
    + PartialEq
    + Send
    + Sync
    + DorySerialize
    + DoryDeserialize
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Neg<Output = Self>
    + for<'a> Add<&'a Self, Output = Self>
    + for<'a> Sub<&'a Self, Output = Self>
    + for<'a> Mul<&'a Self, Output = Self> {
    // Required methods
    fn zero() -> Self;
    fn one() -> Self;
    fn is_zero(&self) -> bool;
    fn add(&self, rhs: &Self) -> Self;
    fn sub(&self, rhs: &Self) -> Self;
    fn mul(&self, rhs: &Self) -> Self;
    fn inv(self) -> Option<Self>;
    fn random() -> Self;
    fn from_u64(val: u64) -> Self;
    fn from_i64(val: i64) -> Self;
}

Required Methods§

Source

fn zero() -> Self

Source

fn one() -> Self

Source

fn is_zero(&self) -> bool

Source

fn add(&self, rhs: &Self) -> Self

Source

fn sub(&self, rhs: &Self) -> Self

Source

fn mul(&self, rhs: &Self) -> Self

Source

fn inv(self) -> Option<Self>

Source

fn random() -> Self

Source

fn from_u64(val: u64) -> Self

Source

fn from_i64(val: i64) -> Self

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§