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 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,
}