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§
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.