pub struct InfiniteDbStore { /* private fields */ }Expand description
A durable store for frp graph entities backed by InfiniteDb.
Uses a write-through cache: all reads are served from in-memory
HashMaps (required because the store traits return borrowed &Self::*
references). Writes go to both the in-memory cache and the database WAL.
Call flush before process exit to seal buffered WAL
records into on-disk blocks.
Implementations§
Source§impl InfiniteDbStore
impl InfiniteDbStore
Sourcepub fn open(dir: impl AsRef<Path>) -> Result<Self, StoreError>
pub fn open(dir: impl AsRef<Path>) -> Result<Self, StoreError>
Open (or create) the database at dir, register all frp spaces,
and warm the in-memory caches by replaying every live record.
Sourcepub fn flush(&mut self) -> Result<(), StoreError>
pub fn flush(&mut self) -> Result<(), StoreError>
Seal all buffered WAL records into on-disk blocks.
Call this before process exit to ensure durability.
Trait Implementations§
Source§impl AtomStore for InfiniteDbStore
impl AtomStore for InfiniteDbStore
Source§fn put_atom(&mut self, atom: Atom) -> Result<(), StoreError>
fn put_atom(&mut self, atom: Atom) -> 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<&Atom>, StoreError>
fn query_atoms(&self, query: &Query) -> Result<QueryResult<&Atom>, StoreError>
Return a paged, optionally-filtered collection of atoms.
Source§impl BlockStore for InfiniteDbStore
impl BlockStore for InfiniteDbStore
Source§fn delete_block(&mut self, id: BlockId) -> Result<(), StoreError>
fn delete_block(&mut self, id: BlockId) -> Result<(), StoreError>
Delete a block by ID. Returns
StoreError::NotFound if absent.Source§fn query_blocks(&self, query: &Query) -> Result<QueryResult<&Block>, StoreError>
fn query_blocks(&self, query: &Query) -> Result<QueryResult<&Block>, StoreError>
Return a paged, optionally-filtered collection of blocks.
Source§impl EdgeStore for InfiniteDbStore
impl EdgeStore for InfiniteDbStore
Source§fn delete_edge(&mut self, id: EdgeId) -> Result<(), StoreError>
fn delete_edge(&mut self, id: EdgeId) -> Result<(), StoreError>
Delete an edge by ID. Returns
StoreError::NotFound if absent.Source§fn query_edges(
&self,
query: &Query,
) -> Result<QueryResult<&HyperEdge>, StoreError>
fn query_edges( &self, query: &Query, ) -> Result<QueryResult<&HyperEdge>, StoreError>
Return a paged, optionally-filtered collection of edges.
Auto Trait Implementations§
impl !Freeze for InfiniteDbStore
impl !RefUnwindSafe for InfiniteDbStore
impl Send for InfiniteDbStore
impl Sync for InfiniteDbStore
impl Unpin for InfiniteDbStore
impl UnsafeUnpin for InfiniteDbStore
impl !UnwindSafe for InfiniteDbStore
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