use super::*;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Frag {
Set(Key, Value),
Del(Key),
Base(tree::Node, bool),
ChildSplit(ChildSplit),
ParentSplit(ParentSplit),
}
impl Frag {
pub fn base(&self) -> Option<(tree::Node, bool)> {
match *self {
Frag::Base(ref base, ref root) => Some((base.clone(), *root)),
_ => None,
}
}
pub fn into_base(self) -> Option<(tree::Node, bool)> {
match self {
Frag::Base(base, root) => Some((base, root)),
_ => None,
}
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ParentSplit {
pub at: Bound,
pub to: PageID,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChildSplit {
pub at: Bound,
pub to: PageID,
}