Skip to main content

SafeCmp

Trait SafeCmp 

Source
pub trait SafeCmp<Rhs> {
    // Required methods
    fn safe_eq(&self, other: Rhs) -> bool;
    fn safe_less(&self, other: Rhs) -> bool;
}
Expand description

Trait for safe signed-to-unsigned and mixed-integer comparisons.

Required Methods§

Source

fn safe_eq(&self, other: Rhs) -> bool

Source

fn safe_less(&self, other: Rhs) -> bool

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl SafeCmp<bool> for bool

Source§

fn safe_eq(&self, other: bool) -> bool

Source§

fn safe_less(&self, other: bool) -> bool

Source§

impl SafeCmp<i64> for i64

Source§

fn safe_eq(&self, other: i64) -> bool

Source§

fn safe_less(&self, other: i64) -> bool

Source§

impl SafeCmp<i64> for u64

Source§

fn safe_eq(&self, other: i64) -> bool

Source§

fn safe_less(&self, other: i64) -> bool

Source§

impl SafeCmp<u64> for i64

Source§

fn safe_eq(&self, other: u64) -> bool

Source§

fn safe_less(&self, other: u64) -> bool

Source§

impl SafeCmp<u64> for u64

Source§

fn safe_eq(&self, other: u64) -> bool

Source§

fn safe_less(&self, other: u64) -> bool

Implementors§