pub trait Guard {
// Required methods
fn into_inner_if(
self,
pred: impl Fn(&UserKey) -> bool,
) -> Result<Option<KvPair>>;
fn into_inner(self) -> Result<KvPair>;
fn key(self) -> Result<UserKey>;
fn size(self) -> Result<u32>;
// Provided method
fn value(self) -> Result<UserValue>
where Self: Sized { ... }
}Expand description
Guard to access key-value pairs
Required Methods§
Sourcefn into_inner_if(
self,
pred: impl Fn(&UserKey) -> bool,
) -> Result<Option<KvPair>>
fn into_inner_if( self, pred: impl Fn(&UserKey) -> bool, ) -> Result<Option<KvPair>>
Accesses the key-value pair if the predicate returns true.
The predicate receives the key - if returning false, the value may not be loaded if the tree is key-value separated.
§Errors
Will return Err if an IO error occurs.
Sourcefn into_inner(self) -> Result<KvPair>
fn into_inner(self) -> Result<KvPair>
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.