use crate::layout::{BlobGuid, NodeType};
use crate::store::backend::AlignedBlobBuf;
#[derive(Debug)]
pub enum LookupResult<'a> {
Found(&'a [u8]),
NotFound,
Crossing(BlobNodeCrossing),
}
#[derive(Debug, Clone, Copy)]
pub struct BlobNodeCrossing {
pub child_guid: BlobGuid,
pub child_depth: usize,
}
#[derive(Debug)]
pub struct InsertOutcome {
pub root_dirty: bool,
pub previous: Option<Vec<u8>>,
}
#[derive(Debug)]
pub struct EraseOutcome {
pub root_dirty: bool,
pub mutated: bool,
pub previous: Option<Vec<u8>>,
}
#[derive(Debug)]
pub struct MakeBlobOutcome {
pub buf: AlignedBlobBuf,
}
#[derive(Debug)]
pub(super) struct InsertReturn {
pub(super) slot_after: u16,
pub(super) previous: Option<Vec<u8>>,
}
#[derive(Debug)]
pub(super) enum EraseSignal {
Unchanged,
SubtreeGone,
Replaced(u16),
}
#[derive(Debug)]
pub(super) struct EraseReturn {
pub(super) signal: EraseSignal,
pub(super) mutated: bool,
pub(super) previous: Option<Vec<u8>>,
}
#[derive(Debug, Clone, Copy)]
pub(super) enum VictimEdgeKind {
Prefix,
Inner(NodeType),
}
#[derive(Debug, Clone, Copy)]
pub(super) struct Victim {
pub(super) parent_slot: u16,
pub(super) kind: VictimEdgeKind,
pub(super) byte: u8,
pub(super) victim_slot: u16,
pub(super) via_header_root: bool,
}