Lattice

Trait Lattice 

Source
pub trait Lattice: Clone + PartialEq {
    // Required method
    fn merge(&self, other: &Self) -> Self;
}
Expand description

A join-semilattice: a set equipped with a commutative, associative, idempotent merge.

Implementors must guarantee the following laws for all values a, b, c:

  • Commutativity: a.merge(&b) == b.merge(&a)
  • Associativity: a.merge(&b).merge(&c) == a.merge(&b.merge(&c))
  • Idempotency: a.merge(&a) == a

Required Methods§

Source

fn merge(&self, other: &Self) -> Self

Compute the least upper bound of self and other.

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§