use frp_plexus::{AtomId, BlockId, EdgeId};
use crate::error::StoreError;
use crate::query::{Query, QueryResult};
pub trait AtomStore {
type Atom;
fn get_atom(&self, id: AtomId) -> Result<&Self::Atom, StoreError>;
fn put_atom(&mut self, atom: Self::Atom) -> Result<(), StoreError>;
fn delete_atom(&mut self, id: AtomId) -> Result<(), StoreError>;
fn query_atoms(&self, query: &Query) -> Result<QueryResult<&Self::Atom>, StoreError>;
}
pub trait BlockStore {
type Block;
fn get_block(&self, id: BlockId) -> Result<&Self::Block, StoreError>;
fn put_block(&mut self, block: Self::Block) -> Result<(), StoreError>;
fn delete_block(&mut self, id: BlockId) -> Result<(), StoreError>;
fn query_blocks(&self, query: &Query) -> Result<QueryResult<&Self::Block>, StoreError>;
}
pub trait EdgeStore {
type Edge;
fn get_edge(&self, id: EdgeId) -> Result<&Self::Edge, StoreError>;
fn put_edge(&mut self, edge: Self::Edge) -> Result<(), StoreError>;
fn delete_edge(&mut self, id: EdgeId) -> Result<(), StoreError>;
fn query_edges(&self, query: &Query) -> Result<QueryResult<&Self::Edge>, StoreError>;
}