CheckedOperator

Trait CheckedOperator 

Source
pub trait CheckedOperator<T> {
    // Required method
    fn apply(a: &T, b: &T) -> Option<T>;
}
Expand description

Trait for checked arithmetic operators.

Required Methods§

Source

fn apply(a: &T, b: &T) -> Option<T>

Apply the operator to the two operands, returning None on overflow/underflow.

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§