pub trait Zero { fn zero() -> Self; }
Types that have a "zero" value.
This trait is intended for use in conjunction with Add
, as an identity: x + T::zero() == x
.
fn zero() -> Self
The "zero" (usually, additive identity) for this type.
impl Zero for u8
impl Zero for u16
impl Zero for u32
impl Zero for u64
impl Zero for usize
impl Zero for i8
impl Zero for i16
impl Zero for i32
impl Zero for i64
impl Zero for isize
impl Zero for u128
impl Zero for i128
impl Zero for f32
impl Zero for f64
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/num/trait.Zero.html