pub enum Load<K, V, P> {
Entry {
key: K,
value: V,
populated: Populated,
},
Piece {
piece: Piece<K, V, P>,
populated: Populated,
},
Throttled,
Miss,
}Expand description
Load result.
Variants§
Entry
Load entry success.
Piece
Load entry success from disk cache write queue.
Fields
Throttled
The entry may be in the disk cache, the read io is throttled.
Miss
Disk cache miss.
Implementations§
Source§impl<K, V, P> Load<K, V, P>
impl<K, V, P> Load<K, V, P>
Sourcepub fn entry(self) -> Option<(K, V, Populated)>
pub fn entry(self) -> Option<(K, V, Populated)>
Return Some with the entry if load success, otherwise return None.
Sourcepub fn kv(self) -> Option<(K, V)>
pub fn kv(self) -> Option<(K, V)>
Return Some with the entry if load success, otherwise return None.
Only key and value will be returned.
Sourcepub fn is_throttled(&self) -> bool
pub fn is_throttled(&self) -> bool
Check if the load result is miss caused by io throttled.
Trait Implementations§
Auto Trait Implementations§
impl<K, V, P> Freeze for Load<K, V, P>
impl<K, V, P> RefUnwindSafe for Load<K, V, P>
impl<K, V, P> Send for Load<K, V, P>
impl<K, V, P> Sync for Load<K, V, P>
impl<K, V, P> Unpin for Load<K, V, P>
impl<K, V, P> UnwindSafe for Load<K, V, P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more