Skip to main content

Zero

Trait Zero 

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

    // Provided methods
    fn is_zero(&self) -> Choice { ... }
    fn set_zero(&mut self) { ... }
    fn zero_like(other: &Self) -> Self
       where Self: Clone { ... }
}
Expand description

Zero values: additive identity element for Self.

Required Methods§

Source

fn zero() -> Self

Returns the additive identity element of Self, 0.

Provided Methods§

Source

fn is_zero(&self) -> Choice

Determine if this value is equal to 0.

§Returns

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

Source

fn set_zero(&mut self)

Set self to its additive identity, i.e. Self::zero.

Source

fn zero_like(other: &Self) -> Self
where Self: Clone,

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 Zero for BoxedUint

Source§

impl Zero for Limb

Source§

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

Source§

impl<T: Zero> Zero for Wrapping<T>

Source§

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

Source§

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