pub enum Evictability {
Always,
Expensive,
Never,
}Expand description
Eviction policy for a ValueType.
Orthogonal to ValueTypePersistence: a cell can be both persistable
and non-evictable (e.g. DiskFileSystem, which holds session-scoped file
watchers but whose serializable fields can still round-trip the cache).
Variants§
Always
Cells of this type can be freely dropped from in-memory storage on
the eviction sweep. The next reader either restores from disk
(Persistable), recomputes from the producing task’s inputs
(Skip / HashOnly), or — for HashOnly — short-circuits via the
stored content_hash if the value is unchanged. Default when evict
is omitted.
Expensive
Cells are evictable, but re-deriving them is non-trivial (e.g. WASM
compile, spawning a Node process pool). Eviction policy may prefer
evicting cheaper cells first. Maps to evict = "last".
Never
Cells must stay in memory across the session. Required for value
types holding interior-mutable state (State<> cells,
Arc<Mutex<_>> dedup histories) or session-scoped handles (file
watchers, worker pools, plugin DSOs) — re-running the producing
task would lose the accumulated state. Maps to evict = "never".
Auto Trait Implementations§
impl Freeze for Evictability
impl RefUnwindSafe for Evictability
impl Send for Evictability
impl Sync for Evictability
impl Unpin for Evictability
impl UnsafeUnpin for Evictability
impl UnwindSafe for Evictability
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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> ⓘ
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> ⓘ
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