pub struct InMemoryAtomStore<V: Clone> { /* private fields */ }Expand description
A HashMap-backed AtomStore for any Clone atom type.
Kind/tag filtering in AtomStore::query_atoms is deferred to the
domain layer — this implementation returns all atoms subject only to
limit/offset pagination.
Implementations§
Trait Implementations§
Source§impl<V: Clone + HasAtomId> AtomStore for InMemoryAtomStore<V>
impl<V: Clone + HasAtomId> AtomStore for InMemoryAtomStore<V>
Source§fn put_atom(&mut self, atom: V) -> Result<(), StoreError>
fn put_atom(&mut self, atom: V) -> Result<(), StoreError>
Insert or replace an atom. The atom’s ID is used as the key.
Source§fn delete_atom(&mut self, id: AtomId) -> Result<(), StoreError>
fn delete_atom(&mut self, id: AtomId) -> Result<(), StoreError>
Delete an atom by ID. Returns
StoreError::NotFound if absent.Source§fn query_atoms(&self, query: &Query) -> Result<QueryResult<&V>, StoreError>
fn query_atoms(&self, query: &Query) -> Result<QueryResult<&V>, StoreError>
Return a paged, optionally-filtered collection of atoms.
Auto Trait Implementations§
impl<V> Freeze for InMemoryAtomStore<V>
impl<V> RefUnwindSafe for InMemoryAtomStore<V>where
V: RefUnwindSafe,
impl<V> Send for InMemoryAtomStore<V>where
V: Send,
impl<V> Sync for InMemoryAtomStore<V>where
V: Sync,
impl<V> Unpin for InMemoryAtomStore<V>where
V: Unpin,
impl<V> UnsafeUnpin for InMemoryAtomStore<V>
impl<V> UnwindSafe for InMemoryAtomStore<V>where
V: UnwindSafe,
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