1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
pub mod cardinality;
pub mod max;
pub mod key;
pub mod checksum;
use std::marker::PhantomData;
use std::borrow::Cow;
use Val;
use stash::Location;
pub use meta::cardinality::Cardinality;
pub use meta::checksum::CheckSum;
pub use meta::max::Max;
pub use meta::key::Key;
pub trait Meta<T>
where Self: Clone,
T: Val
{
fn from_t(t: &T) -> Self;
fn merge(&mut self, other: &Self, _t: PhantomData<T>);
}
pub trait SubMeta<T>
where T: Clone
{
fn submeta(&self) -> Cow<T>;
}
#[derive(Debug)]
pub enum Selection {
Hit,
Between,
Miss,
}
pub trait Select<T>
where Self: Sized + Clone
{
fn select(&mut self, other: Cow<Self>) -> Selection;
}
pub enum Found<T, M>
where T: Val,
M: Meta<T>
{
Node(Location<T, M>),
Miss,
Hit,
Between,
}