Struct pickledb::PickleDbIteratorItem [−][src]
The object returned in each iteration when iterating over keys and values in PickleDB
Implementations
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]
V: DeserializeOwned,
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
impl<'a> RefUnwindSafe for PickleDbIteratorItem<'a>
impl<'a> Send for PickleDbIteratorItem<'a>
impl<'a> Sync for PickleDbIteratorItem<'a>
impl<'a> Unpin for PickleDbIteratorItem<'a>
impl<'a> UnwindSafe for PickleDbIteratorItem<'a>
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>,