Trait lmdb_zero::error::LmdbResultExt
[−]
[src]
pub trait LmdbResultExt {
type Inner;
fn to_opt(self) -> Result<Option<Self::Inner>>;
fn ignore_exists(self, inner: Self::Inner) -> Self;
}Extension methods for LMDB results
Associated Types
type Inner
Required Methods
fn to_opt(self) -> Result<Option<Self::Inner>>
Lift "not found" errors to None.
If Ok(val), return Ok(Some(val)). If Err but the code is
NOTFOUND, return Ok(None). Otherwise, return self.
fn ignore_exists(self, inner: Self::Inner) -> Self
Suppress KEYEXIST errors.
If this is Err and the code is KEYEXIST, switch to Ok with the
given inner value.
Implementors
impl<T> LmdbResultExt for Result<T>