Addable

Trait Addable 

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

Trait for types that support addition.

This is the Rust equivalent of Python’s SupportsAdd protocol.

Required Methods§

Source

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

Add another value to this one

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§

Source§

impl<T: Clone + Add<Output = T>> Addable for T