Lattice

Derive Macro Lattice 

Source
#[derive(Lattice)]
Expand description

Derive the Lattice trait for a struct with named fields.

Each field must implement Lattice. The generated merge delegates to Lattice::merge on each field independently:

use tirea_state::Lattice;
use tirea_state_derive::Lattice;

#[derive(Clone, PartialEq, Lattice)]
struct Composite {
    counter: GCounter,
    flag: Flag,
}

Generic type parameters automatically get a Lattice bound. Errors on tuple structs, unit structs, and enums.