Trait lattices::Merge

source ·
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§

source

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§

source

fn merge_owned(this: Self, delta: Other) -> Self
where Self: Sized,

Merge this and delta together, returning the new value.

Implementations on Foreign Types§

source§

impl Merge<()> for ()

source§

fn merge(&mut self, _other: Self) -> bool

Implementors§

source§

impl<Inner, Other> Merge<WithBot<Other>> for WithBot<Inner>
where Inner: Merge<Other> + LatticeFrom<Other>, Other: IsBot,

source§

impl<Inner, Other> Merge<WithTop<Other>> for WithTop<Inner>
where Inner: Merge<Other> + LatticeFrom<Other>,

source§

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: Extend<Item> + Len + for<'a> Get<&'a Item>, TombstoneSetOther: IntoIterator<Item = Item>,

source§

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>,

source§

impl<LatASelf, LatAOther, LatBSelf, LatBOther> Merge<Pair<LatAOther, LatBOther>> for Pair<LatASelf, LatBSelf>
where LatASelf: Merge<LatAOther>, LatBSelf: Merge<LatBOther>,

source§

impl<LatSelf, LatOther> Merge<VecUnion<LatOther>> for VecUnion<LatSelf>
where LatSelf: Merge<LatOther> + LatticeFrom<LatOther>,

source§

impl<MapSelf, MapOther, K> Merge<UnionFind<MapOther>> for UnionFind<MapSelf>
where MapSelf: MapMut<K, Cell<K>, Key = K, Item = Cell<K>>, MapOther: IntoIterator<Item = (K, Cell<K>)>, K: Copy + Eq,

source§

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,

source§

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: Extend<K> + Len + for<'a> Get<&'a K> + Iter<Item = K>, TombstoneSetOther: IntoIterator<Item = K>,

source§

impl<SetSelf, SetOther, Item> Merge<SetUnion<SetOther>> for SetUnion<SetSelf>
where SetSelf: Extend<Item> + Len, SetOther: IntoIterator<Item = Item>,

source§

impl<T> Merge<Max<T>> for Max<T>
where T: Ord,

source§

impl<T> Merge<Min<T>> for Min<T>
where T: Ord,

source§

impl<T, O> Merge<Conflict<O>> for Conflict<T>
where T: PartialEq<O>,

source§

impl<T, Provenance> Merge<Point<T, Provenance>> for Point<T, Provenance>
where T: PartialEq,