Struct lsm::Database [−][src]
The main database structure This struct can be accessed concurrently and you should never instantiate it more than once for the same on-disk files
Implementations
impl<K: 'static + KV_Trait, V: 'static + KV_Trait> Database<K, V>
[src]
pub async fn new(mode: StartMode) -> Self
[src]
Create a new database instance with default parameters
pub async fn new_with_params(mode: StartMode, params: Params) -> Self
[src]
Create a new database instance with specific parameters
pub async fn get(&self, key: &K) -> Option<V>
[src]
Will deserialize V from the raw data (avoids an additional copy)
pub async fn put(&self, key: &K, value: &V) -> Result<(), WriteError>
[src]
Store
pub async fn put_opts(
&self,
key: &K,
value: &V,
opts: &WriteOptions
) -> Result<(), WriteError>
[src]
&self,
key: &K,
value: &V,
opts: &WriteOptions
) -> Result<(), WriteError>
pub async fn iter(&self) -> DbIterator<K, V>
[src]
pub async fn write(
&self,
write_batch: WriteBatch<K, V>
) -> Result<(), WriteError>
[src]
&self,
write_batch: WriteBatch<K, V>
) -> Result<(), WriteError>
Write a batch of updates to the database
If you only want to write to a single key, use Database::put
instead
pub async fn write_opts(
&self,
write_batch: WriteBatch<K, V>,
opts: &WriteOptions
) -> Result<(), WriteError>
[src]
&self,
write_batch: WriteBatch<K, V>,
opts: &WriteOptions
) -> Result<(), WriteError>
Write a batch of updates to the database This version of write allows you to specfiy options such as “synchronous”
Trait Implementations
Auto Trait Implementations
impl<K, V> !RefUnwindSafe for Database<K, V>
impl<K, V> Send for Database<K, V>
impl<K, V> Sync for Database<K, V>
impl<K, V> Unpin for Database<K, V>
impl<K, V> !UnwindSafe for Database<K, V>
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,
pub 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.
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>,