[][src]Struct pickledb::PickleDbIteratorItem

pub struct PickleDbIteratorItem<'a> { /* fields omitted */ }

The object returned in each iteration when iterating over keys and values in PickleDB

Methods

impl<'a> PickleDbIteratorItem<'a>[src]

pub fn get_key(&self) -> &str[src]

Get the key

pub fn get_value<V>(&self) -> Option<V> where
    V: DeserializeOwned
[src]

Get the value of the key.

The key is always a string but the value can be of any type. It's the user's responsibility to know the value type and give it while calling this method. If the key doesn't exist or if the type is wrong, None will be returned. Otherwise Some(V) will be returned. Since the values are stored in a serialized way the returned object is not a reference to the value stored in a DB but actually a new instance of it. The method returns Some(V) if deserialization succeeds or None otherwise.

Auto Trait Implementations

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, U> Into<U> for T where
    U: From<T>, 
[src]

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.