pub struct Record<E>where
E: Eviction,{ /* private fields */ }Expand description
Record holds the information of the cached entry.
Implementations§
Source§impl<E> Record<E>where
E: Eviction,
impl<E> Record<E>where
E: Eviction,
Sourcepub const STATE_OFFSET: usize = _
pub const STATE_OFFSET: usize = _
state field memory layout offset of the Record.
Sourcepub fn state(&self) -> &UnsafeCell<E::State>
pub fn state(&self) -> &UnsafeCell<E::State>
Get the record state wrapped with UnsafeCell.
§Safety
Sourcepub fn set_in_eviction(&self, val: bool)
pub fn set_in_eviction(&self, val: bool)
Set in eviction flag with relaxed memory order.
Sourcepub fn is_in_eviction(&self) -> bool
pub fn is_in_eviction(&self) -> bool
Get in eviction flag with relaxed memory order.
Sourcepub fn set_in_indexer(&self, val: bool)
pub fn set_in_indexer(&self, val: bool)
Set in indexer flag with relaxed memory order.
Sourcepub fn is_in_indexer(&self) -> bool
pub fn is_in_indexer(&self) -> bool
Get in indexer flag with relaxed memory order.
Sourcepub fn set_ephemeral(&self, val: bool)
pub fn set_ephemeral(&self, val: bool)
Set ephemeral flag with relaxed memory order.
Sourcepub fn is_ephemeral(&self) -> bool
pub fn is_ephemeral(&self) -> bool
Get ephemeral flag with relaxed memory order.
Trait Implementations§
impl<E> Send for Record<E>where
E: Eviction,
impl<E> Sync for Record<E>where
E: Eviction,
Auto Trait Implementations§
impl<E> !Freeze for Record<E>
impl<E> !RefUnwindSafe for Record<E>
impl<E> Unpin for Record<E>
impl<E> UnwindSafe for Record<E>where
<E as Eviction>::State: UnwindSafe,
<E as Eviction>::Key: UnwindSafe,
<E as Eviction>::Value: UnwindSafe,
<E as Eviction>::Hint: 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more