Struct Storage

Source
pub struct Storage;

Trait Implementations§

Source§

impl<'a, K, V> AsIterator<'a, K, V> for Storage

Source§

type AsIter = StorageIterator<K, V>

Type to iterate through the <K, V> collection.
Source§

fn iter(&'a self) -> Result<Self::AsIter, Self::Error>

Returns a Iterator object for the provided <K, V> collection.
Source§

impl<K, V> Batch<K, V> for Storage

Source§

fn batch_insert( &self, _batch: &mut Self::Batch, _key: &K, _value: &V, ) -> Result<(), Self::Error>

Add Insert batch operation for the provided key value pair into the Batch memory buffer.
Source§

fn batch_delete( &self, _batch: &mut Self::Batch, _key: &K, ) -> Result<(), Self::Error>

Add Delete batch operation for the provided key value pair into the Batch memory buffer.
Source§

impl BatchBuilder for Storage

Source§

type Batch = StorageBatch

Type that acts like a memory buffer which queue all the write operations.
Source§

fn batch_commit( &self, _batch: Self::Batch, _durability: bool, ) -> Result<(), Self::Error>

Takes ownership of a batch object in order to commit it to the backend. Durability argument determines if the batch needs to be logged into a write ahead log or not.
Source§

fn batch_begin() -> Self::Batch

Creates and returns the constraint Batch object.
Source§

impl<K, V> Delete<K, V> for Storage

Source§

fn delete(&self, _key: &K) -> Result<(), Self::Error>

Deletes the value associated with the key from the storage.
Source§

impl<K, V> Exist<K, V> for Storage

Source§

fn exist(&self, _key: &K) -> Result<bool, Self::Error>

Checks if a value exists in the storage for the given key.
Source§

impl<K, V> Fetch<K, V> for Storage

Source§

fn fetch(&self, _key: &K) -> Result<Option<V>, Self::Error>

Fetches the value associated with the key from the storage.
Source§

impl<K, V> Insert<K, V> for Storage

Source§

fn insert(&self, _key: &K, _value: &V) -> Result<(), Self::Error>

Inserts the (K, V) pair in the storage.
Source§

impl<'a, K: 'a, V: 'a> MultiFetch<'a, K, V> for Storage

Source§

type Iter = MultiIter<K, V>

The iterator associated type over values.
Source§

fn multi_fetch(&'a self, _keys: &'a [K]) -> Result<Self::Iter, Self::Error>

Fetches the values associated with the keys from the storage.
Source§

impl StorageBackend for Storage

Source§

type ConfigBuilder = ()

Helps build the associated Config.
Source§

type Config = ()

Holds the backend options.
Source§

type Error = Infallible

Returned on failed operations.
Source§

fn start(_config: Self::Config) -> Result<Self, Self::Error>

Initializes and starts the backend.
Source§

fn shutdown(self) -> Result<(), Self::Error>

Shutdowns the backend.
Source§

fn size(&self) -> Result<Option<usize>, Self::Error>

Returns the size of the database in bytes. Not all backends may be able to provide this operation.
Source§

fn get_health(&self) -> Result<Option<StorageHealth>, Self::Error>

Returns the health status of the database. Not all backends may be able to provide this operation.
Source§

fn set_health(&self, _health: StorageHealth) -> Result<(), Self::Error>

Sets the health status of the database. Not all backends may be able to provide this operation.
Source§

impl<K, V> Truncate<K, V> for Storage

Source§

fn truncate(&self) -> Result<(), Self::Error>

Truncates all the entries associated with the (K, V) pair from the storage.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.