Trait SafeSub

Source
pub trait SafeSub: Sized {
    // Required method
    fn safe_sub(self, rhs: Self) -> Result<Self, MathError>;
}
Expand description

Same as checked_sub functions but returns an error

Required Methods§

Source

fn safe_sub(self, rhs: Self) -> Result<Self, MathError>

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 SafeSub for i16

Source§

impl SafeSub for i32

Source§

impl SafeSub for i64

Source§

impl SafeSub for u8

Source§

fn safe_sub(self, rhs: u8) -> Result<u8, MathError>

Source§

impl SafeSub for u16

Source§

impl SafeSub for u32

Source§

impl SafeSub for u64

Source§

impl SafeSub for usize

Implementors§