Skip to main content

SyncerState

Struct SyncerState 

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

Implementations§

Source§

impl SyncerState

Source

pub fn open(dir: PathBuf) -> LeanResult<SyncerState>

Source

pub fn marker_present(&self) -> bool

Source

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.

Source

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.

Source

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.

Source

pub fn drained_path(&self) -> PathBuf

Source

pub fn write_marker(&self) -> LeanResult<()>

Written LAST at checkout: the agent-start gate.

Source

pub fn load_baseline(&self) -> LeanResult<Baseline>

Source

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.

Source

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.

Source

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.

Source

pub fn load_scope_intent(&self) -> LeanResult<Option<ScopeIntent>>

Read a rescope in flight. None = none in flight.

Source

pub fn save_scope_intent(&self, intent: &ScopeIntent) -> LeanResult<()>

Source

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.

Source

pub fn load_incarnation(&self) -> LeanResult<Option<Incarnation>>

Source

pub fn save_incarnation(&self, i: &Incarnation) -> LeanResult<()>

Source

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.

Source

pub fn save_untracked_sweep_at(&self, at: u64) -> LeanResult<()>

Source

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.

Source

pub fn save_orphan_sweep_at(&self, at: u64) -> LeanResult<()>

Source

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.

Source

pub fn save_retire_cache( &self, c: &BTreeMap<String, RetireLog>, ) -> LeanResult<()>

Source

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.

Source

pub fn save_conformance(&self, c: &StoreConformance) -> LeanResult<()>

Source

pub fn load_intent(&self) -> LeanResult<IntentJournal>

Source

pub fn save_intent(&self, j: &IntentJournal) -> LeanResult<()>

Source

pub fn clear_intent_keys(&self) -> LeanResult<()>

The barrier is over: no flush in flight. The carrier stays.

Source

pub fn append_conflict(&self, c: &ConflictRecord) -> LeanResult<()>

Source

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.

Source

pub fn load_conflicts(&self) -> LeanResult<Vec<ConflictRecord>>

The rotated generation first, then the live one: oldest to newest, unbroken across a single rotation.

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.