pub struct RefClosure { /* private fields */ }Expand description
The ref-table-closure alkblobs::LivenessSource — the first
alkgit-owned liveness source (substrate.md §GC; ADR-019 §6). See
the module docs for the walk, the bridge, and the invalidation
decision.
Implementations§
Source§impl RefClosure
impl RefClosure
Sourcepub fn new(
front: ObjectFront,
rows: Arc<dyn RefRows>,
writes: Arc<AtomicU64>,
) -> Arc<Self> ⓘ
pub fn new( front: ObjectFront, rows: Arc<dyn RefRows>, writes: Arc<AtomicU64>, ) -> Arc<Self> ⓘ
The closure source over the object front, the refs rows seam,
and the composition’s shared write counter (bumped by the
refs writes — crate::refs::VersionedRefTable on the sqlite
assembly).
Sourcepub fn register(self: &Arc<Self>, store: &Store) -> Result<Registration, Error>
pub fn register(self: &Arc<Self>, store: &Store) -> Result<Registration, Error>
Register the source with the store — the live-shared seam
(Store::register_liveness_source; alkblobs store-api.md
§Lifecycle). Registered at the composition’s construction;
deregistration/re-registration around a direct delete is the
ADR-012 §6.4 embedder correction flow (out of scope here).
The composition carries this source for the store’s lifetime (registration once, at construction — the returned token is deregister-at-most-once and is the composition’s to keep).
Sourcepub fn keys_builds(&self) -> u64
pub fn keys_builds(&self) -> u64
How many closure walks have run — the memoization pin (a fingerprint hit consumes no walk; the arbitration consult never triggers one).
Trait Implementations§
Source§impl LivenessSource for RefClosure
impl LivenessSource for RefClosure
Source§fn live_keys(&self) -> Vec<Key>
fn live_keys(&self) -> Vec<Key>
The mark-time consult — the whole live set of the refs
closure, bridged through the front’s async-context posture
(multi-thread runtime floor). Fingerprint hit = no walk; a
failed snapshot consult answers empty (the next mark corrects
it). The delete leg is not widened by it: arbitration consults
this impl’s trait-method contains, which answers against the
same memo the
failed mark left untouched — the staged pool-wide candidates
are guarded by the stale-epoch answer, so the deletion set is
the residual class documented in the module docs, not the
snapshot failure’s. The alternative postures (blocking or
panicking the sweep’s mark) are worse.
Source§fn contains(&self, key: &Key) -> bool
fn contains(&self, key: &Key) -> bool
The delete-time arbitration consult — under the store’s arbitration lock, quick, indexed, never blocking (no bridge, no reads, no recompute):
- an index hit answers exactly (
true— the key was live at the memo’s build); - a cold (never-built) memo answers
true— the safe default (unknown is live); - an index miss after an in-process refs write answers
truetoo — the write counter moved past the build, so the candidate’s coverage state is unknown: cancel it now, let the next mark’s rebuild decide. A ref delete between mark and arbitration lands here the safe way too (kept one more sweep, reclaimed after the rebuilt mark confirms).