pub struct Effects { /* private fields */ }Expand description
Captured effects from an operation. This struct can be used to return Effects from a turbo-tasks function and apply them later.
§Cell semantics
Effects uses cell = "new": every producer re-execution allocates a fresh cell value and
the prior cell is dropped. Cell-level dedup of Effects is given up; per-key dedup at apply
time is provided by EffectStateStorage’s state machine (see
EffectStateStorage::run_apply), which short-circuits when storage already holds
Applied { value_hash } matching the new hash.
Effects::apply is idempotent and safe to call multiple times on the same value — the state
machine in run_apply ensures each underlying side effect runs at most once per stored
(key, value_hash) pair across all callers.
Implementations§
Source§impl Effects
impl Effects
Sourcepub fn cell(self) -> Vc<Self>
pub fn cell(self) -> Vc<Self>
Places a value in a cell of the current task.
Cell is selected based on the value type and call order of cell.
Sourcepub fn resolved_cell(self) -> ResolvedVc<Self>
pub fn resolved_cell(self) -> ResolvedVc<Self>
Places a value in a cell of the current task. Returns a
ResolvedVc.
Cell is selected based on the value type and call order of cell.
Trait Implementations§
impl Eq for Effects
impl NonLocalValue for Effects
Source§impl PartialEq for Effects
PartialEq/Eq are compat shims so containing structs (which derive PartialEq/Eq via
turbo_tasks::value) can still embed Effects. The actual cell-update strategy for Effects
itself is cell = "new" — see the doc-comment above — so this PartialEq is not consulted
for Effects cells. We always return false to match cell = "new" semantics for the
wrapper structs (they should also refresh on every producer run).
impl PartialEq for Effects
PartialEq/Eq are compat shims so containing structs (which derive PartialEq/Eq via
turbo_tasks::value) can still embed Effects. The actual cell-update strategy for Effects
itself is cell = "new" — see the doc-comment above — so this PartialEq is not consulted
for Effects cells. We always return false to match cell = "new" semantics for the
wrapper structs (they should also refresh on every producer run).
Source§impl ShrinkToFit for Effects
impl ShrinkToFit for Effects
fn shrink_to_fit(&mut self)
Source§impl TraceRawVcs for Effects
impl TraceRawVcs for Effects
fn trace_raw_vcs(&self, __context__: &mut TraceRawVcsContext)
fn get_raw_vcs(&self) -> Vec<RawVc>
impl Upcast<Box<dyn ValueDebug>> for Effects
impl UpcastStrict<Box<dyn ValueDebug>> for Effects
Source§impl ValueDebug for Effects
impl ValueDebug for Effects
Source§impl ValueDebugFormat for Effects
Available on debug-assertions enabled only.
impl ValueDebugFormat for Effects
fn value_debug_format<'a>(&'a self, depth: usize) -> ValueDebugFormatString<'a>
Source§impl VcValueType for Effects
impl VcValueType for Effects
Source§type Read = VcDefaultRead<Effects>
type Read = VcDefaultRead<Effects>
Source§type CellMode = VcCellNewMode<Effects>
type CellMode = VcCellNewMode<Effects>
Source§fn get_value_type_id() -> ValueTypeId
fn get_value_type_id() -> ValueTypeId
fn has_serialization() -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for Effects
impl !UnwindSafe for Effects
impl Freeze for Effects
impl Send for Effects
impl Sync for Effects
impl Unpin for Effects
impl UnsafeUnpin for Effects
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> DynEq for T
§impl<T> DynPartialEq for T
impl<T> DynPartialEq for T
fn dyn_partial_eq(&self, other: &(dyn Any + 'static)) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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