pub trait Commute: Sized {
// Required method
fn merge(&mut self, other: Self);
// Provided method
fn consume<I: Iterator<Item = Self>>(&mut self, other: I) { ... }
}
Expand description
Defines an interface for types that have an identity and can be commuted.
The value returned by Default::default
must be its identity with respect
to the merge
operation.
Required Methods§
Provided 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.