Skip to main content

CheckedSub

Trait CheckedSub 

Source
pub trait CheckedSub<Rhs = Self>: Sized {
    // Required method
    fn checked_sub(&self, rhs: &Rhs) -> CtOption<Self>;
}
Expand description

Checked subtraction.

Required Methods§

Source

fn checked_sub(&self, rhs: &Rhs) -> CtOption<Self>

Perform checked subtraction, returning a CtOption which is_some only if the operation did not underflow.

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.

Implementors§

Source§

impl CheckedSub for Limb

Source§

impl<Rhs: AsRef<UintRef>> CheckedSub<Rhs> for BoxedUint

Available on crate feature alloc only.
Source§

impl<const LIMBS: usize> CheckedSub for Int<LIMBS>

Source§

impl<const LIMBS: usize> CheckedSub for Uint<LIMBS>