Struct entity_sled::SledDatabase [−][src]
pub struct SledDatabase(_);
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
impl SledDatabase
[src]
pub fn new(db: Db) -> Self
[src]
Creates a new instance of the database wrapping a sled::Db
pub fn ids(&self) -> HashSet<Id>
[src]
Returns ids of all ents stored in the database
pub fn has_id(&self, id: Id) -> bool
[src]
Returns true if database contains the provided id
pub fn ids_for_type(&self, type: &str) -> HashSet<Id>
[src]
Returns ids of all ents for the given type
Trait Implementations
impl Clone for SledDatabase
[src]
fn clone(&self) -> SledDatabase
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Database for SledDatabase
[src]
fn get_all(&self, ids: Vec<Id>) -> DatabaseResult<Vec<Box<dyn Ent>>>
[src]
fn find_all(&self, query: Query) -> DatabaseResult<Vec<Box<dyn Ent>>>
[src]
fn get(&self, id: Id) -> DatabaseResult<Option<Box<dyn Ent>>>
[src]
fn remove(&self, id: Id) -> DatabaseResult<bool>
[src]
fn insert(&self, ent: Box<dyn Ent>) -> DatabaseResult<Id>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for SledDatabase
impl Send for SledDatabase
impl Sync for SledDatabase
impl Unpin for SledDatabase
impl !UnwindSafe for SledDatabase
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsAny for T where
T: 'static,
[src]
T: 'static,
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DatabaseExt for T where
T: Database,
[src]
T: Database,
pub fn insert_typed<E>(&self, ent: E) -> Result<usize, DatabaseError> where
E: Ent,
[src]
E: Ent,
pub fn get_typed<E>(&self, id: usize) -> Result<Option<E>, DatabaseError> where
E: Ent,
[src]
E: Ent,
pub fn get_all_typed<E>(
&self,
ids: Vec<usize, Global>
) -> Result<Vec<E, Global>, DatabaseError> where
E: Ent,
[src]
&self,
ids: Vec<usize, Global>
) -> Result<Vec<E, Global>, DatabaseError> where
E: Ent,
pub fn find_all_typed<E>(
&self,
query: Query
) -> Result<Vec<E, Global>, DatabaseError> where
E: Ent,
[src]
&self,
query: Query
) -> Result<Vec<E, Global>, DatabaseError> where
E: Ent,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,