CheckedSub

Trait CheckedSub 

Source
pub trait CheckedSub<T>: Sized {
    type Output;

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

Safe subtraction.

Required Associated Types§

Source

type Output

The output type.

Required Methods§

Source

fn checked_sub(&self, rhs: T) -> Option<Self::Output>

Subtracts two items.

  • If the subtraction occurs successfully, then Some<Self> is returned.
  • If the subtraction would overflow, None is returned.

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<u32> for omics_coordinate::position::base::Position

Source§

impl CheckedSub<u32> for omics_coordinate::position::interbase::Position