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_slot: u16,
pub child_depth: usize,
}
#[derive(Debug)]
pub struct InsertOutcome {
#[cfg_attr(not(test), allow(dead_code))]
pub new_root_slot: u16,
pub previous: Option<Vec<u8>>,
}
#[derive(Debug)]
pub struct EraseOutcome {
#[cfg_attr(not(test), allow(dead_code))]
pub new_root_slot: u16,
pub previous: Option<Vec<u8>>,
}
#[derive(Debug)]
pub struct MakeBlobOutcome {
pub buf: AlignedBlobBuf,
pub entry_slot: u16,
}
#[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) 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,
}