Trait num_traits::identities::One [−][src]
pub trait One: Sized + Mul<Self, Output = Self> { fn one() -> Self; fn is_one(&self) -> bool
where
Self: PartialEq, { ... } }
Defines a multiplicative identity element for Self.
Required Methods
fn one() -> Self
Provided Methods
fn is_one(&self) -> bool where
Self: PartialEq,
Self: PartialEq,
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.
Implementations on Foreign Types
impl<T: One> One for Wrapping<T> where
Wrapping<T>: Mul<Output = Wrapping<T>>, [src]
impl<T: One> One for Wrapping<T> where
Wrapping<T>: Mul<Output = Wrapping<T>>, Implementors
impl One for usizeimpl One for u8impl One for u16impl One for u32impl One for u64impl One for u128impl One for isizeimpl One for i8impl One for i16impl One for i32impl One for i64impl One for i128impl One for f32impl One for f64