omics_coordinate

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl CheckedSub<usize> for omics_coordinate::position::one::Position

source§

impl CheckedSub<usize> for omics_coordinate::position::zero::Position