# Trait differential_dataflow::lattice::Lattice

``````pub trait Lattice: PartialOrder {
// Required methods
fn join(&self, other: &Self) -> Self;
fn meet(&self, other: &Self) -> Self;

// Provided methods
fn join_assign(&mut self, other: &Self)
where Self: Sized { ... }
fn meet_assign(&mut self, other: &Self)
where Self: Sized { ... }
fn advance_by(&mut self, frontier: AntichainRef<'_, Self>)
where Self: Sized { ... }
}``````
Expand description

A bounded partially ordered type supporting joins and meets.

## Required Methods§

source

#### fn join(&self, other: &Self) -> Self

The smallest element greater than or equal to both arguments.

##### §Examples
``````
let time1 = Product::new(3, 7);
let time2 = Product::new(4, 6);
let join = time1.join(&time2);

assert_eq!(join, Product::new(4, 7));``````
source

#### fn meet(&self, other: &Self) -> Self

The largest element less than or equal to both arguments.

##### §Examples
``````
let time1 = Product::new(3, 7);
let time2 = Product::new(4, 6);
let meet = time1.meet(&time2);

assert_eq!(meet, Product::new(3, 6));``````

## Provided Methods§

source

#### fn join_assign(&mut self, other: &Self)where Self: Sized,

Updates `self` to the smallest element greater than or equal to both arguments.

##### §Examples
``````
let mut time1 = Product::new(3, 7);
let time2 = Product::new(4, 6);
time1.join_assign(&time2);

assert_eq!(time1, Product::new(4, 7));``````
source

#### fn meet_assign(&mut self, other: &Self)where Self: Sized,

Updates `self` to the largest element less than or equal to both arguments.

##### §Examples
``````
let mut time1 = Product::new(3, 7);
let time2 = Product::new(4, 6);
time1.meet_assign(&time2);

assert_eq!(time1, Product::new(3, 6));``````
source

#### fn advance_by(&mut self, frontier: AntichainRef<'_, Self>)where Self: Sized,

Advances self to the largest time indistinguishable under `frontier`.

This method produces the “largest” lattice element with the property that for every lattice element greater than some element of `frontier`, both the result and `self` compare identically to the lattice element. The result is the “largest” element in the sense that any other element with the same property (compares identically to times greater or equal to `frontier`) must be less or equal to the result.

When provided an empty frontier `self` is not modified.

##### §Examples
``````
use timely::progress::frontier::{Antichain, AntichainRef};

let time = Product::new(3, 7);
let mut advanced = Product::new(3, 7);
let frontier = Antichain::from(vec![Product::new(4, 8), Product::new(5, 3)]);

// `time` and `advanced` are indistinguishable to elements >= an element of `frontier`
for i in 0 .. 10 {
for j in 0 .. 10 {
let test = Product::new(i, j);
// for `test` in the future of `frontier` ..
if frontier.less_equal(&test) {
}
}
}

## Object Safety§

This trait is not object safe.

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§