Trait Zero

trait Zero: Sized + Add<Self, Output = Self>

Defines an additive identity element for Self.

Laws

a + 0 = a       ∀ a ∈ Self
0 + a = a       ∀ a ∈ Self

Required Methods

fn zero() -> Self

Returns the additive identity element of Self, 0.

Purity

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.

fn is_zero(self: &Self) -> bool

Returns true if self is equal to the additive identity.

Provided Methods

fn set_zero(self: &mut Self)

Sets self to the additive identity element of Self, 0.

Implementors