pub struct Database { /* private fields */ }
Implementations§
source§impl Database
impl Database
pub fn location(&self) -> PathBuf
pub fn new<KVS: KeyValueStore + 'static>( location: PathBuf, ) -> Result<Self, Error>
pub fn get_raw( &self, path: Option<PathBuf>, pk: &[u8], ) -> Result<Option<Vec<u8>>, Error>
pub fn get<I: Indexable + for<'a> Deserialize<'a>>( &self, path: Option<PathBuf>, pk: &[u8], ) -> Result<Option<I>, Error>
pub fn get_all<I: Indexable + for<'a> Deserialize<'a>>( &self, path: Option<PathBuf>, ) -> Result<Vec<I>, Error>
pub fn keys(&self, path: Option<PathBuf>) -> Result<Vec<Vec<u8>>, Error>
pub fn set<I: Indexable + Serialize>( &mut self, path: Option<PathBuf>, item: &I, ) -> Result<(), Error>
pub fn delete(&mut self, path: Option<PathBuf>, pk: &[u8]) -> Result<(), Error>
pub fn clear(&mut self, path: Option<PathBuf>) -> Result<(), Error>
pub fn query<I: Indexable + for<'a> Deserialize<'a>>( &self, path: Option<PathBuf>, filters: &Filters, sort_options: Option<SortOptions>, ) -> Result<(Vec<I>, Option<Vec<u8>>), Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Database
impl !RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl !UnwindSafe for Database
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)