ZeroableThing

Trait ZeroableThing 

Source
pub trait ZeroableThing: Sized {
    const ZERO: Self;

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

Describes a trait for some types that are valid when passed as a zero

mainly for usage with ShouldNotBeZero

Required Associated Constants§

Source

const ZERO: Self

Required Methods§

Source

fn is_zero(&self) -> bool

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 ZeroableThing for i8

Source§

const ZERO: i8 = 0i8

Source§

fn is_zero(&self) -> bool

Source§

impl ZeroableThing for i16

Source§

const ZERO: i16 = 0i16

Source§

fn is_zero(&self) -> bool

Source§

impl ZeroableThing for i32

Source§

const ZERO: i32 = 0i32

Source§

fn is_zero(&self) -> bool

Source§

impl ZeroableThing for i64

Source§

const ZERO: i64 = 0i64

Source§

fn is_zero(&self) -> bool

Source§

impl ZeroableThing for i128

Source§

const ZERO: i128 = 0i128

Source§

fn is_zero(&self) -> bool

Source§

impl ZeroableThing for isize

Source§

const ZERO: isize = 0isize

Source§

fn is_zero(&self) -> bool

Source§

impl ZeroableThing for u8

Source§

const ZERO: u8 = 0u8

Source§

fn is_zero(&self) -> bool

Source§

impl ZeroableThing for u16

Source§

const ZERO: u16 = 0u16

Source§

fn is_zero(&self) -> bool

Source§

impl ZeroableThing for u32

Source§

const ZERO: u32 = 0u32

Source§

fn is_zero(&self) -> bool

Source§

impl ZeroableThing for u64

Source§

const ZERO: u64 = 0u64

Source§

fn is_zero(&self) -> bool

Source§

impl ZeroableThing for u128

Source§

const ZERO: u128 = 0u128

Source§

fn is_zero(&self) -> bool

Source§

impl ZeroableThing for usize

Source§

const ZERO: usize = 0usize

Source§

fn is_zero(&self) -> bool

Implementors§