pub struct EffectStateStorage { /* private fields */ }Expand description
Shared state storage for tracking applied effects. Stored on the filesystem implementation (e.g. DiskFileSystemInner).
Implementations§
Source§impl EffectStateStorage
impl EffectStateStorage
Sourcepub fn matches_applied(&self, key: &[u8], target: u128) -> bool
pub fn matches_applied(&self, key: &[u8], target: u128) -> bool
Returns true if the per-key state holds Applied { value_hash == target, result: Ok(()) }.
Intended for use by Effect::capture to elide content materialization when the apply
would dedup. Reading this from inside a turbo-tasks task is sound because
Effects::apply re-checks at apply time and fires the producing task’s invalidator on
mismatch (via the ApplyError::Retry / EffectsError::Retry pathway).
Sourcepub async fn run_apply<E, F, Fut>(
&self,
key: Box<[u8]>,
value_hash: u128,
body: Option<F>,
) -> Result<(), ApplyError>
pub async fn run_apply<E, F, Fut>( &self, key: Box<[u8]>, value_hash: u128, body: Option<F>, ) -> Result<(), ApplyError>
Coordinate an apply for (key, value_hash) against the per-key state machine.
Dedup hits (state already Applied with a matching hash) return the cached result without
running body. Otherwise body runs once under an InProgress guard and the result is
stored. A None body (capture elided content because storage matched, but it no longer
does) yields ApplyError::Retry.
Trait Implementations§
Source§impl Default for EffectStateStorage
impl Default for EffectStateStorage
Source§fn default() -> EffectStateStorage
fn default() -> EffectStateStorage
Auto Trait Implementations§
impl !Freeze for EffectStateStorage
impl !RefUnwindSafe for EffectStateStorage
impl Send for EffectStateStorage
impl Sync for EffectStateStorage
impl Unpin for EffectStateStorage
impl UnsafeUnpin for EffectStateStorage
impl !UnwindSafe for EffectStateStorage
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