pub struct ExprTreeStores { /* private fields */ }Expand description
Typed source/control/derived stores plus explicit Table/Dir mount descriptors.
Implementations§
Source§impl ExprTreeStores
impl ExprTreeStores
Sourcepub fn new(root_dir: DirId) -> Result<Self, StoreError>
pub fn new(root_dir: DirId) -> Result<Self, StoreError>
Compose a tree over an existing root directory.
Sourcepub fn reopen(
root_dir: DirId,
source: BTreeMap<CellId, SourceEntry>,
control: BTreeMap<String, ControlEntry>,
derived: BTreeMap<CellId, DerivedEntry>,
mounts: Vec<MountDescriptor>,
) -> Result<Self, StoreError>
pub fn reopen( root_dir: DirId, source: BTreeMap<CellId, SourceEntry>, control: BTreeMap<String, ControlEntry>, derived: BTreeMap<CellId, DerivedEntry>, mounts: Vec<MountDescriptor>, ) -> Result<Self, StoreError>
Reopen persisted stores, validating the mount table before accepting it.
Sourcepub fn source_entry(&self, id: &CellId) -> Option<&SourceEntry>
pub fn source_entry(&self, id: &CellId) -> Option<&SourceEntry>
Authored source entries only.
Sourcepub fn control_entry(&self, key: &str) -> Option<&ControlEntry>
pub fn control_entry(&self, key: &str) -> Option<&ControlEntry>
Operational control entries only.
Sourcepub fn derived_entry(&self, id: &CellId) -> Option<&DerivedEntry>
pub fn derived_entry(&self, id: &CellId) -> Option<&DerivedEntry>
Rebuildable derived entries only.
Sourcepub fn mounts(&self) -> impl Iterator<Item = &MountDescriptor>
pub fn mounts(&self) -> impl Iterator<Item = &MountDescriptor>
All current explicit mounts.
Sourcepub fn return_value_without_mounting(&self, _resource: MountResource) -> usize
pub fn return_value_without_mounting(&self, _resource: MountResource) -> usize
Return a Table or Dir value to the caller without mutating the namespace.
Sourcepub fn mount(&mut self, descriptor: MountDescriptor) -> Result<(), StoreError>
pub fn mount(&mut self, descriptor: MountDescriptor) -> Result<(), StoreError>
Explicitly mount a Table or Dir descriptor.
Sourcepub fn unmount(
&mut self,
path: &TablePath,
) -> Result<MountDescriptor, StoreError>
pub fn unmount( &mut self, path: &TablePath, ) -> Result<MountDescriptor, StoreError>
Removes and returns one explicit mount descriptor.
Sourcepub fn observe_mount_epoch(
&mut self,
path: &TablePath,
epoch: MountEpoch,
) -> Result<(), StoreError>
pub fn observe_mount_epoch( &mut self, path: &TablePath, epoch: MountEpoch, ) -> Result<(), StoreError>
Record a mounted backend epoch in the control store.
Sourcepub fn prepare_source_control_commit(
source_writes: BTreeMap<CellId, SourceEntry>,
control_writes: BTreeMap<String, ControlEntry>,
) -> PendingCommit
pub fn prepare_source_control_commit( source_writes: BTreeMap<CellId, SourceEntry>, control_writes: BTreeMap<String, ControlEntry>, ) -> PendingCommit
Prepare a recoverable source/control commit.
The transaction boundary is exactly source plus control. Recovery replays the same pending record until both sides are durable. Derived entries are rebuildable and are not part of this boundary.
Sourcepub fn commit_source(&mut self, pending: &mut PendingCommit)
pub fn commit_source(&mut self, pending: &mut PendingCommit)
Persist the source side of a prepared commit.
Sourcepub fn commit_control(&mut self, pending: &mut PendingCommit)
pub fn commit_control(&mut self, pending: &mut PendingCommit)
Persist the control side of a source-committed commit.
Sourcepub fn recover_commit(&mut self, pending: &mut PendingCommit)
pub fn recover_commit(&mut self, pending: &mut PendingCommit)
Finish or replay a partially persisted source/control commit.
Sourcepub fn put_derived(&mut self, id: CellId, entry: DerivedEntry)
pub fn put_derived(&mut self, id: CellId, entry: DerivedEntry)
Store a rebuildable derived value outside source entries.
Sourcepub fn put_control(&mut self, key: impl Into<String>, entry: ControlEntry)
pub fn put_control(&mut self, key: impl Into<String>, entry: ControlEntry)
Store an operational control value outside source entries.
Sourcepub fn remove_source(&mut self, id: &CellId) -> Option<SourceEntry>
pub fn remove_source(&mut self, id: &CellId) -> Option<SourceEntry>
Removes authored source for a deleted cell.
Trait Implementations§
Source§impl Clone for ExprTreeStores
impl Clone for ExprTreeStores
Source§fn clone(&self) -> ExprTreeStores
fn clone(&self) -> ExprTreeStores
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more