pub struct InMemoryRegistry { /* private fields */ }Expand description
The in-memory default adapter — the batteries-included degenerate case of the family: always-populated, always-correct, single-process; the completeness shape in the crate’s base (no engine dependency, stamp-free per ADR-024 §6 — it builds fresh every construction).
Sequence numbers are process-local but hold the same shape the engine twins carry: monotone over the adapter’s lifetime, assigned only inside a successful mutation, never decreasing — a committed removal advances the watermark while leaving no row.
Implementations§
Trait Implementations§
Source§impl Default for InMemoryRegistry
impl Default for InMemoryRegistry
Source§impl RegistryRead for InMemoryRegistry
impl RegistryRead for InMemoryRegistry
Source§impl RegistryWrite for InMemoryRegistry
impl RegistryWrite for InMemoryRegistry
Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 RepoRecord,
) -> Pin<Box<dyn Future<Output = Result<i64, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 RepoRecord,
) -> Pin<Box<dyn Future<Output = Result<i64, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a repo record.
RegistryError::Invalid on a malformed
id or record, RegistryError::AlreadyExists when the id is
taken. Returns the mutation’s sequence number.Source§fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 RepoRecord,
) -> Pin<Box<dyn Future<Output = Result<i64, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 RepoRecord,
) -> Pin<Box<dyn Future<Output = Result<i64, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Replace a repo record (the grant-mutation path, ADR-011).
RegistryError::Invalid on a malformed record,
RegistryError::NotFound when the id is absent. Returns the
mutation’s sequence number.Source§fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
repo_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<i64, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
repo_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<i64, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a repo record.
RegistryError::NotFound when the id
is absent. Returns the removal’s sequence number.Source§fn watermark<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<i64, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn watermark<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<i64, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The table’s current watermark: the max sequence number ever
assigned (0 on a fresh table). Monotone — a committed removal
advances it even though it leaves no row.
Source§fn rows_since<'life0, 'async_trait>(
&'life0 self,
seq: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<RegistryRow>, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn rows_since<'life0, 'async_trait>(
&'life0 self,
seq: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<RegistryRow>, RegistryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The reconcile catch-up read: every row mutated after
seq, in
sequence order. rows_since(0) is the whole table — the cached
provider’s snapshot-refresh read (whole-table by contract).Auto Trait Implementations§
impl !Freeze for InMemoryRegistry
impl !RefUnwindSafe for InMemoryRegistry
impl Send for InMemoryRegistry
impl Sync for InMemoryRegistry
impl Unpin for InMemoryRegistry
impl UnsafeUnpin for InMemoryRegistry
impl UnwindSafe for InMemoryRegistry
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