Trait ark_ff::One[][src]

pub trait One: Mul<Self, Output = Self> {
    pub fn one() -> Self;

    pub fn set_one(&mut self) { ... }
pub fn is_one(&self) -> bool
        Self: PartialEq<Self>
, { ... } }

Defines a multiplicative identity element for Self.


a * 1 = a       ∀ a ∈ Self
1 * a = a       ∀ a ∈ Self

Required methods

pub fn one() -> Self[src]

Returns the multiplicative identity element of Self, 1.


This function should return the same result at all times regardless of external mutable state, for example values stored in TLS or in static muts.

Loading content...

Provided methods

pub fn set_one(&mut self)[src]

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

pub fn is_one(&self) -> bool where
    Self: PartialEq<Self>, 

Returns true if self is equal to the multiplicative identity.

For performance reasons, it’s best to implement this manually. After a semver bump, this method will be required, and the where Self: PartialEq bound will be removed.

Loading content...

Implementations on Foreign Types

impl<T> One for Wrapping<T> where
    T: One,
    Wrapping<T>: Mul<Wrapping<T>>,
    <Wrapping<T> as Mul<Wrapping<T>>>::Output == Wrapping<T>, 

Loading content...


impl One for f32[src]

impl One for f64[src]

impl One for i8[src]

impl One for i16[src]

impl One for i32[src]

impl One for i64[src]

impl One for i128[src]

impl One for isize[src]

impl One for u8[src]

impl One for u16[src]

impl One for u32[src]

impl One for u64[src]

impl One for u128[src]

impl One for usize[src]

impl<P: CubicExtParameters> One for CubicExtField<P>[src]

impl<P: QuadExtParameters> One for QuadExtField<P>[src]

impl<P: Fp64Parameters> One for Fp64<P>[src]

impl<P: Fp256Parameters> One for Fp256<P>[src]

impl<P: Fp320Parameters> One for Fp320<P>[src]

impl<P: Fp384Parameters> One for Fp384<P>[src]

impl<P: Fp768Parameters> One for Fp768<P>[src]

impl<P: Fp832Parameters> One for Fp832<P>[src]

Loading content...