Trait cgats::PartialAdd

source ·
pub trait PartialAdd<Rhs: Sized>: Sized {
    type Output;

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

Trait to add values that may or may not be compatible. Returns None if either value is not a type that can add.

Required Associated Types§

source

type Output

The output of a successfull add

Required Methods§

source

fn partial_add(&self, rhs: &Rhs) -> Option<Self::Output>

Try to add the two values

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl PartialAdd<f32> for f32

§

type Output = f32

source§

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

Implementors§