Skip to main content

One

Trait One 

Source
pub trait One: CtEq + Sized {
    // Required method
    fn one() -> Self;

    // Provided methods
    fn is_one(&self) -> Choice { ... }
    fn set_one(&mut self) { ... }
    fn one_like(_other: &Self) -> Self { ... }
}
Expand description

One values: multiplicative identity element for Self.

Required Methods§

Source

fn one() -> Self

Returns the multiplicative identity element of Self, 1.

Provided Methods§

Source

fn is_one(&self) -> Choice

Determine if this value is equal to 1.

§Returns

If one, returns Choice(1). Otherwise, returns Choice(0).

Source

fn set_one(&mut self)

Set self to its multiplicative identity, i.e. Self::one.

Source

fn one_like(_other: &Self) -> Self

Return the value 0 with the same precision as other.

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§

Source§

impl One for BoxedUint

Available on crate feature alloc only.
Source§

impl One for Limb

Source§

impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize> One for ConstMontyForm<MOD, LIMBS>

Source§

impl<T> One for NonZero<T>
where T: One, Self: CtEq,

Source§

impl<T> One for Odd<T>
where T: One,

Source§

impl<T: One> One for Wrapping<T>

Source§

impl<const LIMBS: usize> One for Int<LIMBS>

Source§

impl<const LIMBS: usize> One for Uint<LIMBS>