Enum cache_compute::CachedState
source · pub enum CachedState<T> {
EmptyCache,
ValueCached(T),
Inflight,
}
Expand description
An enum representing the state of an instance of Cached
, returned by Cached::force_recompute
.
Variants§
EmptyCache
The cache is empty and there is no inflight computation happening.
ValueCached(T)
A cached value is present.
Inflight
An inflight computation is currently happening.
Implementations§
source§impl<T> CachedState<T>
impl<T> CachedState<T>
sourcepub fn is_inflight(&self) -> bool
pub fn is_inflight(&self) -> bool
Returns true
iff there is an inflight computation happening.
Trait Implementations§
source§impl<T: Clone> Clone for CachedState<T>
impl<T: Clone> Clone for CachedState<T>
source§fn clone(&self) -> CachedState<T>
fn clone(&self) -> CachedState<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for CachedState<T>
impl<T: Debug> Debug for CachedState<T>
source§impl<T: PartialEq> PartialEq<CachedState<T>> for CachedState<T>
impl<T: PartialEq> PartialEq<CachedState<T>> for CachedState<T>
source§fn eq(&self, other: &CachedState<T>) -> bool
fn eq(&self, other: &CachedState<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.