Skip to main content

FieldStore

Struct FieldStore 

Source
pub struct FieldStore { /* private fields */ }

Implementations§

Source§

impl FieldStore

Source

pub fn open(root: impl AsRef<Path>) -> Result<Self>

Create or open a field store rooted at root (the filesystem backend).

Source

pub fn io(&self) -> &IoCounters

The physical-I/O counters shared by this store and its seed substrate.

Every descriptor/manifest/index/seed read made through any handle derived from this store is attributed here; an observation snapshots it before and after to report its own physical bytes (review fix #1).

Source

pub fn root(&self) -> &Path

The store root directory.

Source

pub fn seeds(&self) -> &dyn SeedStore

The seed store (for advanced callers and courts).

Source

pub fn seeds_mut(&mut self) -> &mut dyn SeedStore

Mutable seed store access.

Source

pub fn cache(&self) -> Result<DerivedCache>

Open the disposable derived observation cache (11.8) under this store.

The cache is never normative: it can always be deleted and observations remain correct by recomputation (ADR-0027).

Source

pub fn sync(&self) -> Result<()>

Make every acknowledged write power-durable before the handle is dropped.

The EntropyFS engine acks a put_blob at rename but does not barrier, so a fresh open in another process can miss an unpublishied epoch. Calling this after a mutation closes that gap. The filesystem backend writes atomically (tmp -> fsync -> rename) and needs no barrier.

Source

pub fn put_descriptor(&mut self, bytes: &[u8]) -> Result<Id>

Store a serialized .voldoc descriptor as a content-addressed blob.

Returns the blob’s Id (BLAKE3-256(bytes)), which is what the field manifest binds. Idempotent.

Source

pub fn get_descriptor(&self, id: &Id) -> Result<Vec<u8>>

Fetch a descriptor blob, verifying its content id.

Source

pub fn put_field(&mut self, manifest: &FieldRoot) -> Result<FieldId>

Store a canonical field manifest.

Source

pub fn get_field(&self, id: &FieldId) -> Result<FieldRoot>

Fetch a field manifest, verifying its content id and universe.

Source

pub fn list_fields(&self) -> Result<Vec<FieldId>>

List every stored field manifest id.

The filesystem backend reads the field/ directory. The EntropyFS backend declines with UnsupportedFeature: the engine exposes no per-blob enumeration, so a manifest cannot be listed — but any manifest remains openable by its FieldId (get_field).

Source

pub fn ingest( &mut self, descriptor_bytes: &[u8], limits: Limits, ) -> Result<FieldId>

Ingest a serialized .voldoc descriptor as a new field.

Stage A (durable exact capture): store the descriptor blob and an exact DocumentExact root node, then write the manifest. Deeper Stage-B procedural nodes are added by crate::field::ingest.

Trait Implementations§

Source§

impl Debug for FieldStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.