pub struct TtlCell<T> { /* private fields */ }Implementations§
Source§impl<T> TtlCell<T>
impl<T> TtlCell<T>
pub fn new(ttl: Duration) -> Self
pub fn new_with_value(ttl: Duration, value: T) -> Self
pub fn replace(&mut self, value: T) -> Option<T>
pub fn set(&mut self, value: T)
pub fn clear(&mut self)
pub fn as_ref(&self) -> Option<&T>
pub fn as_ref_with<'a, O>( &'a self, other: &'a TtlCell<O>, max_time_delta: Duration, ) -> Option<(&T, &O)>
pub fn take(&mut self) -> Option<T>
pub fn take_with<O>( &mut self, other: &mut TtlCell<O>, max_time_delta: Duration, ) -> Option<(T, O)>
pub fn as_deref(&self) -> Option<&T::Target>where
T: Deref,
pub fn expired(&self) -> bool
pub fn touch(&mut self)
pub fn set_at(&self) -> Monotonic
Auto Trait Implementations§
impl<T> Freeze for TtlCell<T>where
T: Freeze,
impl<T> RefUnwindSafe for TtlCell<T>where
T: RefUnwindSafe,
impl<T> Send for TtlCell<T>where
T: Send,
impl<T> Sync for TtlCell<T>where
T: Sync,
impl<T> Unpin for TtlCell<T>where
T: Unpin,
impl<T> UnsafeUnpin for TtlCell<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for TtlCell<T>where
T: UnwindSafe,
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