Trait ord_lmdb_zero::error::LmdbResultExt
source · [−]pub trait LmdbResultExt {
type Inner;
fn to_opt(self) -> Result<Option<Self::Inner>>;
fn ignore_exists(self, inner: Self::Inner) -> Self;
}
Expand description
Extension methods for LMDB results
Associated Types
Required methods
Lift “not found” errors to None
.
If Ok(val)
, return Ok(Some(val))
. If Err
but the error is
Error::Code(NOTFOUND)
, return Ok(None)
. Otherwise, return self.
fn ignore_exists(self, inner: Self::Inner) -> Self
fn ignore_exists(self, inner: Self::Inner) -> Self
Suppress KEYEXIST
errors.
If this is Err
and the error is Error::Code(KEYEXIST)
, switch to
Ok
with the given inner value.