Skip to main content

CacheState

Enum CacheState 

Source
pub enum CacheState<Cached> {
    Stale(Cached),
    Actual(Cached),
    Expired(Cached),
}
Expand description

Freshness state of cached data.

Represents the time-based state of a cached value relative to its staleness and expiration timestamps.

Variants§

§

Stale(Cached)

Data is stale but not expired (usable, should refresh in background).

§

Actual(Cached)

Data is fresh and valid.

§

Expired(Cached)

Data has expired (must refresh before use).

Trait Implementations§

Source§

impl<Cached: Debug> Debug for CacheState<Cached>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Cached: PartialEq> PartialEq for CacheState<Cached>

Source§

fn eq(&self, other: &CacheState<Cached>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Cached: Eq> Eq for CacheState<Cached>

Source§

impl<Cached> StructuralPartialEq for CacheState<Cached>

Auto Trait Implementations§

§

impl<Cached> Freeze for CacheState<Cached>
where Cached: Freeze,

§

impl<Cached> RefUnwindSafe for CacheState<Cached>
where Cached: RefUnwindSafe,

§

impl<Cached> Send for CacheState<Cached>
where Cached: Send,

§

impl<Cached> Sync for CacheState<Cached>
where Cached: Sync,

§

impl<Cached> Unpin for CacheState<Cached>
where Cached: Unpin,

§

impl<Cached> UnwindSafe for CacheState<Cached>
where Cached: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.