[−][src]Struct kv::Store
Store is used to read/write data to disk using sled
Methods
impl Store
[src]
pub fn new(config: Config) -> Result<Store, Error>
[src]
Create a new store from the given config
pub fn path(&self) -> Result<&Path, Error>
[src]
Get the store's path
pub fn generate_id(&self) -> Result<u64, Error>
[src]
Generate monotonic ID
pub fn buckets(&self) -> Vec<String>
[src]
Get a list of bucket names
pub fn bucket<'a, K: Key<'a>, V: Value>(
&self,
name: Option<&str>
) -> Result<Bucket<'a, K, V>, Error>
[src]
&self,
name: Option<&str>
) -> Result<Bucket<'a, K, V>, Error>
Open a new bucket
pub fn drop_bucket<S: AsRef<str>>(&self, name: S) -> Result<(), Error>
[src]
Remove a bucket from the store
pub fn size_on_disk(&self) -> Result<u64, Error>
[src]
Returns the size on disk in bytes
pub fn export(
&self
) -> Vec<(Vec<u8>, Vec<u8>, impl Iterator<Item = Vec<Vec<u8>>>)>
[src]
&self
) -> Vec<(Vec<u8>, Vec<u8>, impl Iterator<Item = Vec<Vec<u8>>>)>
Export entire database
pub fn import(
&self,
export: Vec<(Vec<u8>, Vec<u8>, impl Iterator<Item = Vec<Vec<u8>>>)>
)
[src]
&self,
export: Vec<(Vec<u8>, Vec<u8>, impl Iterator<Item = Vec<Vec<u8>>>)>
)
Import from database export
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[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, 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.
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>,