pub trait Merge<Other> {
// Required method
fn merge(&mut self, other: Other) -> bool;
// Provided method
fn merge_owned(this: Self, delta: Other) -> Self
where Self: Sized { ... }
}
Expand description
Trait for lattice merge (AKA “join” or “least upper bound”).
Required Methods§
sourcefn merge(&mut self, other: Other) -> bool
fn merge(&mut self, other: Other) -> bool
Merge other
into the self
lattice.
This operation must be associative, commutative, and idempotent.
Returns true
if self
changed, false
otherwise.
Returning true
implies that the new value for self
is later in the lattice order than
the old value. Returning false
means that self
was unchanged and therefore other
came
before self
(or the two are equal) in the lattice order.
Provided Methods§
sourcefn merge_owned(this: Self, delta: Other) -> Selfwhere
Self: Sized,
fn merge_owned(this: Self, delta: Other) -> Selfwhere
Self: Sized,
Merge this
and delta
together, returning the new value.