Trait Identity

Source
pub trait Identity<N> {
    // Required method
    fn identity(&self) -> N;
}
Expand description

A trait that specifies that this Operation has an identity element.

An identity must satisfy combine(a, id) = a and combine(id, a) = a, where id is something returned by identity.

Required Methods§

Source

fn identity(&self) -> N

Returns an element such that if combined with any element a the result must be a.

Implementors§

Source§

impl Identity<bool> for And

Source§

impl Identity<bool> for Or

Source§

impl Identity<bool> for Xor

Source§

impl Identity<f32> for Add

Source§

impl Identity<f32> for MaxIgnoreNaN

Source§

impl Identity<f32> for MaxTakeNaN

Source§

impl Identity<f32> for MinIgnoreNaN

Source§

impl Identity<f32> for MinTakeNaN

Source§

impl Identity<f32> for Mul

Source§

impl Identity<f64> for Add

Source§

impl Identity<f64> for MaxIgnoreNaN

Source§

impl Identity<f64> for MaxTakeNaN

Source§

impl Identity<f64> for MinIgnoreNaN

Source§

impl Identity<f64> for MinTakeNaN

Source§

impl Identity<f64> for Mul

Source§

impl Identity<i8> for Add

Source§

impl Identity<i8> for And

Source§

impl Identity<i8> for Max

Source§

impl Identity<i8> for Min

Source§

impl Identity<i8> for Mul

Source§

impl Identity<i8> for Or

Source§

impl Identity<i8> for Xor

Source§

impl Identity<i16> for Add

Source§

impl Identity<i16> for And

Source§

impl Identity<i16> for Max

Source§

impl Identity<i16> for Min

Source§

impl Identity<i16> for Mul

Source§

impl Identity<i16> for Or

Source§

impl Identity<i16> for Xor

Source§

impl Identity<i32> for Add

Source§

impl Identity<i32> for And

Source§

impl Identity<i32> for Max

Source§

impl Identity<i32> for Min

Source§

impl Identity<i32> for Mul

Source§

impl Identity<i32> for Or

Source§

impl Identity<i32> for Xor

Source§

impl Identity<i64> for Add

Source§

impl Identity<i64> for And

Source§

impl Identity<i64> for Max

Source§

impl Identity<i64> for Min

Source§

impl Identity<i64> for Mul

Source§

impl Identity<i64> for Or

Source§

impl Identity<i64> for Xor

Source§

impl Identity<i128> for Add

Source§

impl Identity<i128> for And

Source§

impl Identity<i128> for Max

Source§

impl Identity<i128> for Min

Source§

impl Identity<i128> for Mul

Source§

impl Identity<i128> for Or

Source§

impl Identity<i128> for Xor

Source§

impl Identity<isize> for Add

Source§

impl Identity<isize> for And

Source§

impl Identity<isize> for Max

Source§

impl Identity<isize> for Min

Source§

impl Identity<isize> for Mul

Source§

impl Identity<isize> for Or

Source§

impl Identity<isize> for Xor

Source§

impl Identity<u8> for Add

Source§

impl Identity<u8> for And

Source§

impl Identity<u8> for Max

Source§

impl Identity<u8> for Min

Source§

impl Identity<u8> for Mul

Source§

impl Identity<u8> for Or

Source§

impl Identity<u8> for Xor

Source§

impl Identity<u16> for Add

Source§

impl Identity<u16> for And

Source§

impl Identity<u16> for Max

Source§

impl Identity<u16> for Min

Source§

impl Identity<u16> for Mul

Source§

impl Identity<u16> for Or

Source§

impl Identity<u16> for Xor

Source§

impl Identity<u32> for Add

Source§

impl Identity<u32> for And

Source§

impl Identity<u32> for Max

Source§

impl Identity<u32> for Min

Source§

impl Identity<u32> for Mul

Source§

impl Identity<u32> for Or

Source§

impl Identity<u32> for Xor

Source§

impl Identity<u64> for Add

Source§

impl Identity<u64> for And

Source§

impl Identity<u64> for Max

Source§

impl Identity<u64> for Min

Source§

impl Identity<u64> for Mul

Source§

impl Identity<u64> for Or

Source§

impl Identity<u64> for Xor

Source§

impl Identity<u128> for Add

Source§

impl Identity<u128> for And

Source§

impl Identity<u128> for Max

Source§

impl Identity<u128> for Min

Source§

impl Identity<u128> for Mul

Source§

impl Identity<u128> for Or

Source§

impl Identity<u128> for Xor

Source§

impl Identity<usize> for Add

Source§

impl Identity<usize> for And

Source§

impl Identity<usize> for Max

Source§

impl Identity<usize> for Min

Source§

impl Identity<usize> for Mul

Source§

impl Identity<usize> for Or

Source§

impl Identity<usize> for Xor

Source§

impl Identity<Wrapping<i8>> for Add

Source§

impl Identity<Wrapping<i8>> for Mul

Source§

impl Identity<Wrapping<i16>> for Add

Source§

impl Identity<Wrapping<i16>> for Mul

Source§

impl Identity<Wrapping<i32>> for Add

Source§

impl Identity<Wrapping<i32>> for Mul

Source§

impl Identity<Wrapping<i64>> for Add

Source§

impl Identity<Wrapping<i64>> for Mul

Source§

impl Identity<Wrapping<i128>> for Add

Source§

impl Identity<Wrapping<i128>> for Mul

Source§

impl Identity<Wrapping<isize>> for Add

Source§

impl Identity<Wrapping<isize>> for Mul

Source§

impl Identity<Wrapping<u8>> for Add

Source§

impl Identity<Wrapping<u8>> for Mul

Source§

impl Identity<Wrapping<u16>> for Add

Source§

impl Identity<Wrapping<u16>> for Mul

Source§

impl Identity<Wrapping<u32>> for Add

Source§

impl Identity<Wrapping<u32>> for Mul

Source§

impl Identity<Wrapping<u64>> for Add

Source§

impl Identity<Wrapping<u64>> for Mul

Source§

impl Identity<Wrapping<u128>> for Add

Source§

impl Identity<Wrapping<u128>> for Mul

Source§

impl Identity<Wrapping<usize>> for Add

Source§

impl Identity<Wrapping<usize>> for Mul

Source§

impl Identity<BigInt> for Add

Source§

impl Identity<BigInt> for Mul

Source§

impl Identity<BigUint> for Add

Source§

impl Identity<BigUint> for Mul

Source§

impl<TA, TB, A: Identity<TA>, B: Identity<TB>> Identity<(TA, TB)> for Pair<A, B>