pub struct MemoryBackend { /* private fields */ }Expand description
The storage seam, muniment’s (2026-07-12).
Eidetic used to declare its own Store trait — get/put/delete/list over
&str -> Vec<u8>, async, one method per operation. That was
muniment::Backend written twice: eidetic poured its own floor before
muniment existed. It now consumes the real one, and Store remains as an
alias so every layer above (manifests, schemas, sealing, engrams) reads
unchanged.
What the swap buys beyond deleting a duplicate: backends take &self,
delete/list are required rather than Err-by-default, muniment’s
scan (ordered range) and apply (atomic batch) come along, and every
muniment backend (memory, redb) is now an eidetic store — while
eidetic-fjall becomes a backend the whole family can reuse.
An in-memory Backend, the deterministic test and development floor. Not
durable: state lives only as long as the handle. Cheap to clone (a shared
handle), so one instance can seed both a SlotStore and a BlobStore, the
way a real filesystem or OPFS handle is cheap to clone.
Implementations§
Trait Implementations§
Source§impl Backend for MemoryBackend
impl Backend for MemoryBackend
Source§fn apply<'life0, 'life1, 'async_trait>(
&'life0 self,
ops: &'life1 [WriteOp],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBackend: 'async_trait,
fn apply<'life0, 'life1, 'async_trait>(
&'life0 self,
ops: &'life1 [WriteOp],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBackend: 'async_trait,
Atomic under the single mutex: the whole batch applies while the lock is held, so no reader observes a partial batch.
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBackend: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBackend: 'async_trait,
key, or None if absent.Source§fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryBackend: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryBackend: 'async_trait,
bytes at key, overwriting any previous value.Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBackend: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBackend: 'async_trait,
key. Absent keys are not an error.Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBackend: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBackend: 'async_trait,
prefix, in unspecified order.Source§fn scan<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
start: &'life1 str,
end: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryBackend: 'async_trait,
fn scan<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
start: &'life1 str,
end: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryBackend: 'async_trait,
[start, end), in ascending
order. This is the ordered read a log needs: a per-author log lives at
contiguous fixed-width keys, so [lo, hi) returns its entries in seq
order. Implementations back this with a native ordered index (redb ranges,
IndexedDB cursors), or filter and sort list where none
exists. Read moreSource§impl Clone for MemoryBackend
impl Clone for MemoryBackend
Source§fn clone(&self) -> MemoryBackend
fn clone(&self) -> MemoryBackend
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more