pub struct SyncerState { /* private fields */ }Implementations§
Source§impl SyncerState
impl SyncerState
pub fn open(dir: PathBuf) -> LeanResult<SyncerState>
pub fn marker_present(&self) -> bool
Sourcepub fn sync_tree(&self) -> LeanResult<()>
pub fn sync_tree(&self) -> LeanResult<()>
Flush the filesystem holding the tree (the state dir lives in it) so everything materialised so far is on stable storage.
Sourcepub fn write_drained(&self, seq: Option<u64>, acks: usize) -> LeanResult<()>
pub fn write_drained(&self, seq: Option<u64>, acks: usize) -> LeanResult<()>
The drain’s attestation. seq is the manifest the drain left
installed, when it knows it.
Sourcepub fn clear_drained(&self) -> LeanResult<()>
pub fn clear_drained(&self) -> LeanResult<()>
A fresh incarnation owes its own attestation; a stale one from an earlier life of this tree must not vouch for it.
pub fn drained_path(&self) -> PathBuf
Sourcepub fn write_marker(&self) -> LeanResult<()>
pub fn write_marker(&self) -> LeanResult<()>
Written LAST at checkout: the agent-start gate.
pub fn load_baseline(&self) -> LeanResult<Baseline>
Sourcepub fn save_baseline(&self, b: &Baseline) -> LeanResult<()>
pub fn save_baseline(&self, b: &Baseline) -> LeanResult<()>
COMPACT: the baseline is the other O(files) document, rewritten
on the cadence tick and re-parsed several times per barrier. The
agent-facing O(1) files (gauges, capabilities, acks) stay pretty
— those exist to be cat-ed.
Sourcepub fn load_scope(&self) -> LeanResult<Option<Vec<String>>>
pub fn load_scope(&self) -> LeanResult<Option<Vec<String>>>
What this workspace was admitted to hold, or None for an
unscoped (whole-manifest) checkout.
fs::read directly, with NO exists() pre-check: exists()
answers false for EACCES and EIO alike, and an unreadable scope
answered as “unscoped” is the same class of bug as an unreadable
path answered as “deleted” (barrier.rs, 14b3637c). Only
NotFound means absent.
Sourcepub fn save_scope(&self, scope: Option<&[String]>) -> LeanResult<()>
pub fn save_scope(&self, scope: Option<&[String]>) -> LeanResult<()>
Some writes the admitted set; None REMOVES the document.
Removing matters: a scoped checkout that crashed before its
marker leaves a scope behind, and the whole-tree checkout that
replaces it must not inherit a claim it did not make.
Sourcepub fn load_scope_intent(&self) -> LeanResult<Option<ScopeIntent>>
pub fn load_scope_intent(&self) -> LeanResult<Option<ScopeIntent>>
Read a rescope in flight. None = none in flight.
pub fn save_scope_intent(&self, intent: &ScopeIntent) -> LeanResult<()>
Sourcepub fn clear_scope_intent(&self) -> LeanResult<()>
pub fn clear_scope_intent(&self) -> LeanResult<()>
Cleared LAST, after the new scope is durable. Clearing it first would turn a crash into a workspace whose scope says one thing and whose held set says another, with nothing left to replay.
pub fn load_incarnation(&self) -> LeanResult<Option<Incarnation>>
pub fn save_incarnation(&self, i: &Incarnation) -> LeanResult<()>
Sourcepub fn load_untracked_sweep_at(&self) -> LeanResult<u64>
pub fn load_untracked_sweep_at(&self) -> LeanResult<u64>
Unix seconds of this writer’s last untracked-upload sweep; 0 when it has never swept.
pub fn save_untracked_sweep_at(&self, at: u64) -> LeanResult<()>
Sourcepub fn load_orphan_sweep_at(&self) -> LeanResult<u64>
pub fn load_orphan_sweep_at(&self) -> LeanResult<u64>
The orphan sweep’s clock (untracked.rs, sweep_orphans_if_due):
0 = never swept, and the first commit starts it.
pub fn save_orphan_sweep_at(&self, at: u64) -> LeanResult<()>
Sourcepub fn load_retire_cache(&self) -> BTreeMap<String, RetireLog>
pub fn load_retire_cache(&self) -> BTreeMap<String, RetireLog>
The retire logs read so far, by key. A cache: unreadable reads as empty (the logs are fetched again), never as an error.
pub fn save_retire_cache( &self, c: &BTreeMap<String, RetireLog>, ) -> LeanResult<()>
Sourcepub fn load_conformance(&self) -> LeanResult<Option<StoreConformance>>
pub fn load_conformance(&self) -> LeanResult<Option<StoreConformance>>
A verdict that cannot be parsed reads as ABSENT, never as a pass: the probe runs again. The expensive outcome of a corrupt cache is ten requests; the cheap one would be running the collector on a store nobody asked.
pub fn save_conformance(&self, c: &StoreConformance) -> LeanResult<()>
pub fn load_intent(&self) -> LeanResult<IntentJournal>
pub fn save_intent(&self, j: &IntentJournal) -> LeanResult<()>
Sourcepub fn clear_intent_keys(&self) -> LeanResult<()>
pub fn clear_intent_keys(&self) -> LeanResult<()>
The barrier is over: no flush in flight. The carrier stays.
pub fn append_conflict(&self, c: &ConflictRecord) -> LeanResult<()>
Sourcepub fn conflicts_dropped(&self) -> LeanResult<u64>
pub fn conflicts_dropped(&self) -> LeanResult<u64>
Records lost to rotation. A caller rendering conflicts owes the user this number: a truncated list that does not say it was truncated reads as a complete one.
Sourcepub fn load_conflicts(&self) -> LeanResult<Vec<ConflictRecord>>
pub fn load_conflicts(&self) -> LeanResult<Vec<ConflictRecord>>
The rotated generation first, then the live one: oldest to newest, unbroken across a single rotation.