pub struct PackedSeedStore { /* private fields */ }Expand description
A packed content-addressed store of canonical procedural seed nodes.
Implements SeedStore with the same identity, bytes, verification, range,
and enumeration semantics as super::FsSeedStore; only the physical layout
differs (fieldpack/ segments instead of one file per node).
Implementations§
Source§impl PackedSeedStore
impl PackedSeedStore
Sourcepub fn open_read(root: impl AsRef<Path>, io: IoCounters) -> Result<Self>
pub fn open_read(root: impl AsRef<Path>, io: IoCounters) -> Result<Self>
Open the store read-only: sealed segments via their .idx, plus the open
segment (if any) recovered by a framing scan.
Sourcepub fn open_write(root: impl AsRef<Path>, io: IoCounters) -> Result<Self>
pub fn open_write(root: impl AsRef<Path>, io: IoCounters) -> Result<Self>
Open the store read-write, recovering (and truncating the torn tail of) an unsealed segment so appends continue from the last complete record.
Sourcepub fn seal(&self) -> Result<()>
pub fn seal(&self) -> Result<()>
Seal the open segment: fsync it, publish seg-N.idx atomically, and make
it readable. Called by crate::field::FieldStore::sync.
Sourcepub fn insert(&self, canonical: &[u8]) -> Result<NodeId>
pub fn insert(&self, canonical: &[u8]) -> Result<NodeId>
Store the canonical bytes of one node (idempotent).
Sourcepub fn fetch(&self, id: &NodeId) -> Result<Vec<u8>>
pub fn fetch(&self, id: &NodeId) -> Result<Vec<u8>>
Fetch a node, verifying NodeId::of_node(bytes) == id.
Trait Implementations§
Source§impl Debug for PackedSeedStore
impl Debug for PackedSeedStore
Source§impl SeedStore for PackedSeedStore
impl SeedStore for PackedSeedStore
Source§fn put_node(&mut self, canonical: &[u8]) -> Result<NodeId>
fn put_node(&mut self, canonical: &[u8]) -> Result<NodeId>
Source§fn get_node(&self, id: &NodeId) -> Result<Vec<u8>>
fn get_node(&self, id: &NodeId) -> Result<Vec<u8>>
id. Read more