Trait Sum

Source
pub trait Sum {
    // Required method
    fn sum(self, other: Self) -> Self;
}
Expand description

Trait defining the sum of two numbers.

For bool this is the same as boolean OR; otherwise it’s the same as Add.

Required Methods§

Source

fn sum(self, other: Self) -> Self

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.

Implementations on Foreign Types§

Source§

impl Sum for bool

Source§

fn sum(self, other: Self) -> Self

Source§

impl Sum for f32

Source§

fn sum(self, other: Self) -> Self

Source§

impl Sum for f64

Source§

fn sum(self, other: Self) -> Self

Source§

impl Sum for i16

Source§

fn sum(self, other: Self) -> Self

Source§

impl Sum for i32

Source§

fn sum(self, other: Self) -> Self

Source§

impl Sum for i64

Source§

fn sum(self, other: Self) -> Self

Source§

impl Sum for u8

Source§

fn sum(self, other: Self) -> Self

Source§

impl Sum for u16

Source§

fn sum(self, other: Self) -> Self

Source§

impl Sum for u32

Source§

fn sum(self, other: Self) -> Self

Source§

impl Sum for u64

Source§

fn sum(self, other: Self) -> Self

Implementors§