pub struct InMemoryRefTable { /* private fields */ }Expand description
The in-memory refs table — the CAS-semantics reference impl
(engine-free, single-process, stamp-free by construction: it builds
fresh every time and versions nothing durable — ADR-024 §6). Rows
are keyed on the resolved repo id (repo_id → name → row), name-sorted
maps (deterministic listing); the whole call runs under one
short-held write lock — the in-memory “transaction” — with the
atomic abort as simply not committing the call’s working copy
(per-update decisions inside still see their in-call predecessors).
The lock is the async tokio::sync::RwLock: its guard is held
across the (never-yielding) CAS futures’ awaits and is Send —
the GitRefs Send-future surface holds (a blocking guard
across an await would not).
Implementations§
Trait Implementations§
Source§impl Default for InMemoryRefTable
impl Default for InMemoryRefTable
Source§impl GitRefs for InMemoryRefTable
impl GitRefs for InMemoryRefTable
Source§fn list_refs<'life0, 'life1, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRecord,
) -> Pin<Box<dyn Future<Output = Result<Vec<RefLine>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_refs<'life0, 'life1, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRecord,
) -> Pin<Box<dyn Future<Output = Result<Vec<RefLine>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Ref listing — advertisement + ls-refs response data (the full
set; ref-prefix filtering is wire-side, client-driven).
Source§fn apply_updates<'life0, 'life1, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRecord,
updates: Vec<RefUpdate>,
atomic: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<RefOutcome>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn apply_updates<'life0, 'life1, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRecord,
updates: Vec<RefUpdate>,
atomic: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<RefOutcome>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
One CAS transaction per call — the atomic-correctness home
(ADR-013 §7; the substrate row transaction — ADR-019 §2). Runs
the per-ref CAS; per-ref denials are outcomes (
RefOutcome),
not errors (a stale ref is a business result of receive-pack —
ADR-013 §7–8). Read moreSource§impl RefRows for InMemoryRefTable
impl RefRows for InMemoryRefTable
Source§fn snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RefRowsSnapshot, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RefRowsSnapshot, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The full canonical snapshot: all repos’ rows, name-sorted,
with the fingerprint over the canonical form.
Auto Trait Implementations§
impl !Freeze for InMemoryRefTable
impl !RefUnwindSafe for InMemoryRefTable
impl Send for InMemoryRefTable
impl Sync for InMemoryRefTable
impl Unpin for InMemoryRefTable
impl UnsafeUnpin for InMemoryRefTable
impl UnwindSafe for InMemoryRefTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more