Skip to main content

CheckedSub

Trait CheckedSub 

pub trait CheckedSub<Rhs = Self>: Sized {
    type Output;

    // Required method
    fn checked_sub(&self, rhs: Rhs) -> CtOption<Self>;
}
Expand description

Checked subtraction.

Required Associated Types§

type Output

Output type.

Required Methods§

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".

Implementors§

§

impl CheckedSub for Limb

§

type Output = Limb

§

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

§

type Output = Uint<LIMBS>