pub struct Database { /* private fields */ }Implementations§
Source§impl Database
impl Database
pub fn location(&self) -> PathBuf
pub async fn new<KVS: KeyValueStore + 'static>( location: PathBuf, ) -> Result<Self, Error>
pub async fn get_raw(&self, pk: &[u8]) -> Result<Option<Vec<u8>>, Error>
pub async fn get<I: Indexable + for<'a> Deserialize<'a>>( &self, pk: &[u8], ) -> Result<Option<I>, Error>
pub async fn get_all<I: Indexable + for<'a> Deserialize<'a>>( &self, ) -> Result<Vec<I>, Error>
pub async fn keys(&self) -> Result<Vec<Vec<u8>>, Error>
pub async fn set<I: Indexable + Serialize>(&self, item: &I) -> Result<(), Error>
pub async fn delete(&self, pk: &[u8]) -> Result<(), Error>
pub async fn clear(&self) -> Result<(), Error>
pub async fn query<I: Indexable + for<'a> Deserialize<'a>>( &self, filters: &Filters, sort_options: Option<SortOptions>, ) -> Result<(Vec<I>, Option<Vec<u8>>), Error>
pub async fn debug(&self) -> Result<String, 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