lattices/
unit.rs

1use crate::{Atomize, DeepReveal, IsBot, IsTop, LatticeFrom, LatticeOrd, Merge};
2
3impl DeepReveal for () {
4    type Revealed = ();
5
6    fn deep_reveal(self) -> Self::Revealed {
7        self
8    }
9}
10
11impl Merge<Self> for () {
12    fn merge(&mut self, _other: Self) -> bool {
13        false
14    }
15}
16
17impl LatticeOrd for () {}
18
19impl LatticeFrom<Self> for () {
20    fn lattice_from(other: Self) -> Self {
21        other
22    }
23}
24
25impl IsBot for () {
26    fn is_bot(&self) -> bool {
27        true
28    }
29}
30
31impl IsTop for () {
32    fn is_top(&self) -> bool {
33        true
34    }
35}
36
37impl Atomize for () {
38    type Atom = Self;
39
40    type AtomIter = std::iter::Empty<Self>;
41
42    fn atomize(self) -> Self::AtomIter {
43        std::iter::empty()
44    }
45}