Trait Zero

Source
pub trait Zero {
    const ZERO: Self;

    // Required method
    fn is_zero(&self) -> bool;
}

Required Associated Constants§

Source

const ZERO: Self

The zero value for this type.

Required Methods§

Source

fn is_zero(&self) -> bool

Whether the value is zero.

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.

Implementations on Foreign Types§

Source§

impl Zero for u8

Source§

const ZERO: Self = 0u8

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for u16

Source§

const ZERO: Self = 0u16

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for u32

Source§

const ZERO: Self = 0u32

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for u64

Source§

const ZERO: Self = 0u64

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for u128

Source§

const ZERO: Self = 0u128

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for usize

Source§

const ZERO: Self = 0usize

Source§

fn is_zero(&self) -> bool

Implementors§