[][src]Struct tendermint_light_client::store::sled::utils::KeyValueDb

pub struct KeyValueDb<K, V> { /* fields omitted */ }

Provides a view over the database for storing key/value pairs at the given prefix.

Implementations

impl<K, V> KeyValueDb<K, V>[src]

pub fn new(prefix: impl Into<Vec<u8>>) -> Self[src]

Create a view over the database for storing key/value pairs at the given prefix.

impl<K, V> KeyValueDb<K, V> where
    K: Serialize,
    V: Serialize + DeserializeOwned
[src]

pub fn get(&self, db: &Db, key: &K) -> Result<Option<V>, Error>[src]

Get the value associated with a key within this view in the given sled database.

pub fn contains_key(&self, db: &Db, key: &K) -> Result<bool, Error>[src]

Check whether there exists a key within this view in the given sled database.

pub fn insert(&self, db: &Db, key: &K, value: &V) -> Result<(), Error>[src]

Insert a value associated with a key within this view in the given sled database.

pub fn remove(&self, db: &Db, key: &K) -> Result<(), Error>[src]

Remove the value associated with a key within this view in the given sled database.

pub fn iter(&self, db: &Db) -> impl DoubleEndedIterator<Item = V>[src]

Iterate over all values within this view in the given sled database.

Trait Implementations

impl<K: Clone, V: Clone> Clone for KeyValueDb<K, V>[src]

impl<K: Debug, V: Debug> Debug for KeyValueDb<K, V>[src]

Auto Trait Implementations

impl<K, V> RefUnwindSafe for KeyValueDb<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe
[src]

impl<K, V> Send for KeyValueDb<K, V> where
    K: Send,
    V: Send
[src]

impl<K, V> Sync for KeyValueDb<K, V> where
    K: Sync,
    V: Sync
[src]

impl<K, V> Unpin for KeyValueDb<K, V> where
    K: Unpin,
    V: Unpin
[src]

impl<K, V> UnwindSafe for KeyValueDb<K, V> where
    K: UnwindSafe,
    V: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,