Skip to main content

Measure

Trait Measure 

Source
pub trait Measure: Copy {
    // Required methods
    fn zero() -> Self;
    fn checked_add(self, other: Self) -> Option<Self>;
    fn compare(self, other: Self) -> Option<Ordering>;

    // Provided methods
    fn is_negative(self) -> bool { ... }
    fn is_valid(self) -> bool { ... }
}
Expand description

Ordered path cost with checked addition.

Implementations must return a consistent total order for valid values.

Required Methods§

Source

fn zero() -> Self

Source

fn checked_add(self, other: Self) -> Option<Self>

Source

fn compare(self, other: Self) -> Option<Ordering>

Provided Methods§

Source

fn is_negative(self) -> bool

Source

fn is_valid(self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Measure for f32

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

fn is_negative(self) -> bool

Source§

fn is_valid(self) -> bool

Source§

impl Measure for f64

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

fn is_negative(self) -> bool

Source§

fn is_valid(self) -> bool

Source§

impl Measure for i8

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

fn is_negative(self) -> bool

Source§

impl Measure for i16

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

fn is_negative(self) -> bool

Source§

impl Measure for i32

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

fn is_negative(self) -> bool

Source§

impl Measure for i64

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

fn is_negative(self) -> bool

Source§

impl Measure for i128

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

fn is_negative(self) -> bool

Source§

impl Measure for isize

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

fn is_negative(self) -> bool

Source§

impl Measure for u8

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

impl Measure for u16

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

impl Measure for u32

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

impl Measure for u64

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

impl Measure for u128

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Source§

impl Measure for usize

Source§

fn zero() -> Self

Source§

fn checked_add(self, other: Self) -> Option<Self>

Source§

fn compare(self, other: Self) -> Option<Ordering>

Implementors§