pub struct SledDatabase(/* private fields */);Expand description
Represents a sled database that performs synchronous insertion,
retrieval, and removal. Sled maintains disk-backed data, so the serde
feature has no purpose with this database.
Sled itself is thread-safe, maintaining an internal Arc for each tree;
therefore, this database can be cloned to increment those counters.
Implementations§
Source§impl SledDatabase
impl SledDatabase
Sourcepub fn ids_for_type(&self, type: &str) -> HashSet<Id>
pub fn ids_for_type(&self, type: &str) -> HashSet<Id>
Returns ids of all ents for the given type
Trait Implementations§
Source§impl Clone for SledDatabase
impl Clone for SledDatabase
Source§fn clone(&self) -> SledDatabase
fn clone(&self) -> SledDatabase
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Database for SledDatabase
impl Database for SledDatabase
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 SledDatabase
impl !RefUnwindSafe for SledDatabase
impl Send for SledDatabase
impl Sync for SledDatabase
impl Unpin for SledDatabase
impl !UnwindSafe for SledDatabase
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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