omics_coordinate

Trait CheckedAdd

source
pub trait CheckedAdd<T>: Sized {
    type Output;

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

Safe addition.

Required Associated Types§

source

type Output

The output type.

Required Methods§

source

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

Adds two items.

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

Object Safety§

This trait is not object safe.

Implementors§

source§

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

source§

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