Skip to main content

InfiniteDbStore

Struct InfiniteDbStore 

Source
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

Source

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.

Source

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

Source§

type Atom = Atom

The atom value type stored and retrieved by this implementation.
Source§

fn get_atom(&self, id: AtomId) -> Result<&Atom, StoreError>

Retrieve an atom by its ID.
Source§

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>

Delete an atom by ID. Returns StoreError::NotFound if absent.
Source§

fn query_atoms(&self, query: &Query) -> Result<QueryResult<&Atom>, StoreError>

Return a paged, optionally-filtered collection of atoms.
Source§

impl BlockStore for InfiniteDbStore

Source§

type Block = Block

The block value type stored and retrieved by this implementation.
Source§

fn get_block(&self, id: BlockId) -> Result<&Block, StoreError>

Retrieve a block by its ID.
Source§

fn put_block(&mut self, block: Block) -> Result<(), StoreError>

Insert or replace a block.
Source§

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>

Return a paged, optionally-filtered collection of blocks.
Source§

impl EdgeStore for InfiniteDbStore

Source§

type Edge = HyperEdge

The edge value type stored and retrieved by this implementation.
Source§

fn get_edge(&self, id: EdgeId) -> Result<&HyperEdge, StoreError>

Retrieve an edge by its ID.
Source§

fn put_edge(&mut self, edge: HyperEdge) -> Result<(), StoreError>

Insert or replace an edge.
Source§

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>

Return a paged, optionally-filtered collection of edges.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.