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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Implementors§
impl<Head, Node> Merge<GhtInner<Head, Node>> for GhtInner<Head, Node>where
Node: GeneralizedHashTrieNode + Merge<Node>,
Node::Storage: VariadicSet<Schema = Node::Schema>,
Self: GeneralizedHashTrieNode,
Head: Hash + Eq + Clone,
Available on crate feature
std only.impl<Inner, Other> Merge<WithBot<Other>> for WithBot<Inner>
impl<Inner, Other> Merge<WithTop<Other>> for WithTop<Inner>where
Inner: Merge<Other> + LatticeFrom<Other>,
impl<Item, SetSelf, TombstoneSetSelf, SetOther, TombstoneSetOther> Merge<SetUnionWithTombstones<SetOther, TombstoneSetOther>> for SetUnionWithTombstones<SetSelf, TombstoneSetSelf>where
SetSelf: Extend<Item> + Len + for<'a> Remove<&'a Item>,
SetOther: IntoIterator<Item = Item>,
TombstoneSetSelf: TombstoneSet<Item>,
TombstoneSetOther: IntoIterator<Item = Item>,
Available on crate feature
std only.impl<KeySelf, KeyOther, ValSelf, ValOther> Merge<DomPair<KeyOther, ValOther>> for DomPair<KeySelf, ValSelf>where
KeySelf: Merge<KeyOther> + LatticeFrom<KeyOther> + PartialOrd<KeyOther>,
ValSelf: Merge<ValOther> + LatticeFrom<ValOther>,
impl<LatA, LatB, __LatAOther, __LatBOther> Merge<Pair<__LatAOther, __LatBOther>> for Pair<LatA, LatB>
impl<LatSelf, LatOther> Merge<VecUnion<LatOther>> for VecUnion<LatSelf>where
LatSelf: Merge<LatOther> + LatticeFrom<LatOther>,
Available on crate feature
alloc only.impl<MapSelf, MapOther, K, ValSelf, ValOther, TombstoneSetSelf, TombstoneSetOther> Merge<MapUnionWithTombstones<MapOther, TombstoneSetOther>> for MapUnionWithTombstones<MapSelf, TombstoneSetSelf>where
MapSelf: Keyed<Key = K, Item = ValSelf> + Extend<(K, ValSelf)> + for<'a> GetMut<&'a K, Item = ValSelf> + for<'b> Remove<&'b K>,
MapOther: IntoIterator<Item = (K, ValOther)>,
ValSelf: Merge<ValOther> + LatticeFrom<ValOther>,
ValOther: IsBot,
TombstoneSetSelf: TombstoneSet<K>,
TombstoneSetOther: IntoIterator<Item = K>,
Available on crate feature
std only.Merge implementation using TombstoneSet trait for optimized union operations
impl<MapSelf, MapOther, K, ValSelf, ValOther> Merge<MapUnion<MapOther>> for MapUnion<MapSelf>where
MapSelf: Keyed<Key = K, Item = ValSelf> + Extend<(K, ValSelf)> + for<'a> GetMut<&'a K, Item = ValSelf>,
MapOther: IntoIterator<Item = (K, ValOther)>,
ValSelf: Merge<ValOther> + LatticeFrom<ValOther>,
ValOther: IsBot,
Available on crate feature
alloc only.impl<MapSelf, MapOther, K> Merge<UnionFind<MapOther>> for UnionFind<MapSelf>
Available on crate feature
std only.impl<Schema, ValType, Storage> Merge<GhtLeaf<Schema, ValType, Storage>> for GhtLeaf<Schema, ValType, Storage>where
Schema: Eq + Hash,
Storage: VariadicSet<Schema = Schema> + Extend<Schema> + IntoIterator<Item = Schema>,
Available on crate feature
std only.