Skip to main content

IsZero

Trait IsZero 

Source
pub trait IsZero {
    // Required method
    fn is_zero(&self) -> bool;
}
Expand description

A trait for checking if a value is zero.

This trait provides a method to determine if a value is considered to be zero. It is implemented for various numeric and length-related types where the concept of zero is applicable. This can be useful for comparisons, optimizations, or determining if an operation has a neutral effect.

Required Methods§

Source

fn is_zero(&self) -> bool

Determines if the value is zero.

§Returns

Returns true if the value is zero, false otherwise.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§