Enum hitbox::value::CacheState [−][src]
pub enum CacheState<T> { Actual(CachedValue<T>), Stale(CachedValue<T>), Miss, }
Expand description
Represents cuurent state of cached data.
Variants
Actual(CachedValue<T>)
Cached data is exists and actual.
Stale(CachedValue<T>)
Cached data is exists and stale.
Cached data does not exists.
Implementations
impl<T, U> CacheState<T> where
T: CacheableResponse<Cached = U>,
U: DeserializeOwned + Serialize,
[src]
impl<T, U> CacheState<T> where
T: CacheableResponse<Cached = U>,
U: DeserializeOwned + Serialize,
[src]pub fn from_bytes(bytes: Option<&Vec<u8>>) -> Result<Self, CacheError>
[src]
pub fn from_bytes(bytes: Option<&Vec<u8>>) -> Result<Self, CacheError>
[src]Deserialize optional vector of bytes and check the actuality.
Trait Implementations
impl<T, U> From<Option<CachedValue<U>>> for CacheState<T> where
T: CacheableResponse<Cached = U>,
U: Serialize,
[src]
impl<T, U> From<Option<CachedValue<U>>> for CacheState<T> where
T: CacheableResponse<Cached = U>,
U: Serialize,
[src]fn from(cached_value: Option<CachedValue<U>>) -> Self
[src]
fn from(cached_value: Option<CachedValue<U>>) -> Self
[src]Performs the conversion.
Auto Trait Implementations
impl<T> RefUnwindSafe for CacheState<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for CacheState<T> where
T: Send,
T: Send,
impl<T> Sync for CacheState<T> where
T: Sync,
T: Sync,
impl<T> Unpin for CacheState<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for CacheState<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,