pub struct InmemoryDatabase { /* private fields */ }
Expand description
Represents an in-memory database that performs synchronous insertion,
retrieval, and removal. If the feature serde
is enabled, this database
can be serialized and deserialized.
Implementations§
Trait Implementations§
Source§impl Database for InmemoryDatabase
impl Database for InmemoryDatabase
Source§fn get_all(&self, ids: Vec<Id>) -> DatabaseResult<Vec<Box<dyn Ent>>>
fn get_all(&self, ids: Vec<Id>) -> DatabaseResult<Vec<Box<dyn Ent>>>
Performs a retrieval of multiple ents of any type
Source§fn find_all(&self, query: Query) -> DatabaseResult<Vec<Box<dyn Ent>>>
fn find_all(&self, query: Query) -> DatabaseResult<Vec<Box<dyn Ent>>>
Finds all generic ents that match the query
Source§fn get(&self, id: Id) -> DatabaseResult<Option<Box<dyn Ent>>>
fn get(&self, id: Id) -> DatabaseResult<Option<Box<dyn Ent>>>
Retrieves a copy of a single, generic ent with the corresponding id Read more
Auto Trait Implementations§
impl !Freeze for InmemoryDatabase
impl RefUnwindSafe for InmemoryDatabase
impl Send for InmemoryDatabase
impl Sync for InmemoryDatabase
impl Unpin for InmemoryDatabase
impl UnwindSafe for InmemoryDatabase
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
Source§impl<T> DatabaseExt for Twhere
T: Database,
impl<T> DatabaseExt for Twhere
T: Database,
Source§fn insert_typed<E>(&self, ent: E) -> Result<usize, DatabaseError>where
E: Ent,
fn insert_typed<E>(&self, ent: E) -> Result<usize, DatabaseError>where
E: Ent,
Inserts an ent of a specific type
Source§fn get_typed<E>(&self, id: usize) -> Result<Option<E>, DatabaseError>where
E: Ent,
fn get_typed<E>(&self, id: usize) -> Result<Option<E>, DatabaseError>where
E: Ent,
Retrieves an ent by id with a specific type
Source§fn get_all_typed<E>(&self, ids: Vec<usize>) -> Result<Vec<E>, DatabaseError>where
E: Ent,
fn get_all_typed<E>(&self, ids: Vec<usize>) -> Result<Vec<E>, DatabaseError>where
E: Ent,
Retrieves ents by id with a specific type
Source§fn find_all_typed<E>(&self, query: Query) -> Result<Vec<E>, DatabaseError>where
E: Ent,
fn find_all_typed<E>(&self, query: Query) -> Result<Vec<E>, DatabaseError>where
E: Ent,
Finds ents that match the specified query and are of the specified type