pub trait MergeOperator<V>:
Clone
+ Send
+ Sync {
// Required methods
fn merge(&self, left: V, right: V) -> Result<V, MapletError>;
fn identity(&self) -> V;
// Provided methods
fn is_associative(&self) -> bool { ... }
fn is_commutative(&self) -> bool { ... }
}
Expand description
Trait for merge operators that define how values are combined
Required Methods§
Sourcefn merge(&self, left: V, right: V) -> Result<V, MapletError>
fn merge(&self, left: V, right: V) -> Result<V, MapletError>
Merge two values using the operator ⊕
Provided Methods§
Sourcefn is_associative(&self) -> bool
fn is_associative(&self) -> bool
Check if the operator is associative
Sourcefn is_commutative(&self) -> bool
fn is_commutative(&self) -> bool
Check if the operator is commutative
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.