Skip to main content

CheckedAdd

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl CheckedAdd<u32> for omics_coordinate::position::base::Position

Source§

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