pub enum ValueTypePersistence {
Persistable(AnyEncodeFn, AnyDecodeFn<SharedReference>),
SkipPersist {
expensive: bool,
},
HashOnly,
SessionStateful,
}Expand description
Cell-persistence behavior of a ValueType.
Carries the serializer/deserializer pair for Persistable values — today
that’s bincode, but the enum name is neutral so the choice of mechanism can
evolve without a cascade of rename work.
Variants§
Persistable(AnyEncodeFn, AnyDecodeFn<SharedReference>)
Cells are serialized to the persistent cache and restored on next
access after eviction. Maps to serialization = "auto" | "custom".
SkipPersist
The value type opts out of being persisted: re-running the producing
task to reproduce the cell is preferred over serializing the in-memory
form. Cells are evictable; the next reader after eviction triggers a
recompute from the task’s inputs. Maps to
serialization = "skip" (plus an optional evict attribute).
Fields
HashOnly
The value type is not persisted, but the macro emitted a
DeterministicHash derive and the write path stashes a content_hash
into cell_data_hash so post-eviction reads can detect unchanged
content and skip invalidation. Maps to serialization = "hash".
SessionStateful
Not persistable, not reconstructible — holds interior-mutable state
that accumulates across the session (State<> cells, Arc<Mutex<_>>
dedup histories). Re-running the producing task would lose the
accumulated state, so cells of this type must stay in memory across
eviction. Maps to serialization = "skip", evict = "never".
Auto Trait Implementations§
impl Freeze for ValueTypePersistence
impl RefUnwindSafe for ValueTypePersistence
impl Send for ValueTypePersistence
impl Sync for ValueTypePersistence
impl Unpin for ValueTypePersistence
impl UnsafeUnpin for ValueTypePersistence
impl UnwindSafe for ValueTypePersistence
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