MergeOperator

Trait MergeOperator 

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

Source

fn merge(&self, left: V, right: V) -> Result<V, MapletError>

Merge two values using the operator ⊕

Source

fn identity(&self) -> V

Get the identity element for this operator

Provided Methods§

Source

fn is_associative(&self) -> bool

Check if the operator is associative

Source

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.

Implementors§