petgraph::matrix_graph

Trait Zero

Source
pub trait Zero {
    // Required methods
    fn zero() -> Self;
    fn is_zero(&self) -> bool;
}
Expand description

Base trait for types that can be wrapped in a NotZero.

Implementors must provide a singleton object that will be used to mark empty edges in a MatrixGraph.

Note that this trait is already implemented for the base numeric types.

Required Methods§

Source

fn zero() -> Self

Return the singleton object which can be used as a sentinel value.

Source

fn is_zero(&self) -> bool

Return true if self is equal to the sentinel value.

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 f32

Source§

fn zero() -> Self

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for f64

Source§

fn zero() -> Self

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for i8

Source§

fn zero() -> Self

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for i16

Source§

fn zero() -> Self

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for i32

Source§

fn zero() -> Self

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for i64

Source§

fn zero() -> Self

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for isize

Source§

fn zero() -> Self

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for u8

Source§

fn zero() -> Self

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for u16

Source§

fn zero() -> Self

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for u32

Source§

fn zero() -> Self

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for u64

Source§

fn zero() -> Self

Source§

fn is_zero(&self) -> bool

Source§

impl Zero for usize

Source§

fn zero() -> Self

Source§

fn is_zero(&self) -> bool

Implementors§