pub struct Store { /* private fields */ }
Expand description
Store is used to read/write data to disk using sled
Implementations§
source§impl Store
impl Store
sourcepub fn generate_id(&self) -> Result<u64, Error>
pub fn generate_id(&self) -> Result<u64, Error>
Generate monotonic ID
sourcepub fn bucket<'a, K: Key<'a>, V: Value>(
&self,
name: Option<&str>
) -> Result<Bucket<'a, K, V>, Error>
pub fn bucket<'a, K: Key<'a>, V: Value>( &self, name: Option<&str> ) -> Result<Bucket<'a, K, V>, Error>
Open a new bucket
sourcepub fn drop_bucket<S: AsRef<str>>(&self, name: S) -> Result<(), Error>
pub fn drop_bucket<S: AsRef<str>>(&self, name: S) -> Result<(), Error>
Remove a bucket from the store
sourcepub fn size_on_disk(&self) -> Result<u64, Error>
pub fn size_on_disk(&self) -> Result<u64, Error>
Returns the size on disk in bytes
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl !UnwindSafe for Store
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