Skip to main content

Zero

Trait Zero 

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

    // Provided methods
    fn zero() -> Self { ... }
    fn set_zero(&mut self) -> &mut Self { ... }
    fn is_zero(&self) -> bool
       where Self: PartialEq { ... }
    fn is_non_zero(&self) -> bool
       where Self: PartialEq { ... }
}
Expand description

Define the 0 representation : The absorbing element of the multiplication such that x * X::ZERO = X::ZERO

Required Associated Constants§

Source

const ZERO: Self

The absorbing element of the multiplication such that x * X::ZERO = X::ZERO

Provided Methods§

Source

fn zero() -> Self

Source

fn set_zero(&mut self) -> &mut Self

Source

fn is_zero(&self) -> bool
where Self: PartialEq,

Source

fn is_non_zero(&self) -> bool
where Self: PartialEq,

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 bool

Source§

const ZERO: bool = false

Source§

impl Zero for f32

Source§

impl Zero for f64

Source§

impl Zero for i8

Source§

impl Zero for i16

Source§

impl Zero for i32

Source§

impl Zero for i64

Source§

impl Zero for isize

Source§

impl Zero for u8

Source§

impl Zero for u16

Source§

impl Zero for u32

Source§

impl Zero for u64

Source§

impl Zero for usize

Source§

impl<T> Zero for Saturating<T>
where T: Zero,

Source§

impl<T> Zero for Wrapping<T>
where T: Zero,

Source§

impl<T> Zero for ColorHslaOf<T>
where T: Zero + Copy,

Source§

impl<T> Zero for AngleOf<T>
where T: Zero,

Source§

impl<T> Zero for RectangleBase<T>
where T: Zero,

Source§

impl<T> Zero for TimeOf<T>
where T: Zero,

Source§

impl<T, const N: usize> Zero for [T; N]
where T: Zero,

Implementors§

Source§

impl<F, U> Zero for BitFlags<F, U>

Source§

const ZERO: BitFlags<F, U>

Source§

impl<T> Zero for ColorRgbaOf<T>
where T: Zero + Copy,

Source§

impl<T, const N: usize> Zero for Vector<T, N>
where T: Zero,

Source§

const ZERO: Vector<T, N>

Source§

impl<T, const ROW: usize, const COL: usize> Zero for Matrix<T, ROW, COL>
where Vector<Vector<T, ROW>, COL>: Zero,

Source§

const ZERO: Matrix<T, ROW, COL>