[][src]Struct over_there::utils::TtlValue

pub struct TtlValue<T> {
    pub value: T,
    // some fields omitted
}

Represents a value that has a limited lifetime before expiring

Fields

value: T

Implementations

impl TtlValue<()>[src]

pub fn empty(ttl: Duration) -> Self[src]

impl<T> TtlValue<T>[src]

pub fn new(value: T, ttl: Duration) -> Self[src]

pub fn touch(&mut self)[src]

pub fn last_touched(&self) -> &Instant[src]

pub fn ttl(&self) -> &Duration[src]

pub fn has_expired(&self) -> bool[src]

Trait Implementations

impl<T: Clone> Clone for TtlValue<T>[src]

impl<T: Copy> Copy for TtlValue<T>[src]

impl<T: Debug> Debug for TtlValue<T>[src]

impl<T> Deref for TtlValue<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> DerefMut for TtlValue<T>[src]

impl<T: Eq> Eq for TtlValue<T>[src]

impl<T> From<T> for TtlValue<T>[src]

impl<T: Hash> Hash for TtlValue<T>[src]

impl<T> Into<Duration> for TtlValue<T>[src]

impl<T> Into<Instant> for TtlValue<T>[src]

impl<T: Ord> Ord for TtlValue<T>[src]

impl<T: Eq> PartialEq<TtlValue<T>> for TtlValue<T>[src]

impl<T: PartialOrd + Eq> PartialOrd<TtlValue<T>> for TtlValue<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for TtlValue<T> where
    T: RefUnwindSafe

impl<T> Send for TtlValue<T> where
    T: Send

impl<T> Sync for TtlValue<T> where
    T: Sync

impl<T> Unpin for TtlValue<T> where
    T: Unpin

impl<T> UnwindSafe for TtlValue<T> where
    T: UnwindSafe

Blanket Implementations

impl<T, A, P> Access<T> for P where
    A: Access<T>,
    P: Deref<Target = A>, 
[src]

type Guard = <A as Access<T>>::Guard

A guard object containing the value and keeping it alive. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, A> DynAccess<T> for A where
    A: Access<T>,
    <A as Access<T>>::Guard: 'static, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,