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.
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.
Source§impl Effects
impl Effects
Sourcepub async fn apply(&self) -> Result<(), Arc<dyn EffectError>>
pub async fn apply(&self) -> Result<(), Arc<dyn EffectError>>
Applies all effects that have been captured.
On first call: groups effects by key, detects duplicates/conflicts, caches deduped indices. On subsequent calls: skips grouping (reuses cached indices), only runs per-key state checks.
apply must only be used in a “top-level” task (e.g. run_once), after
take_effects is called from an operation read with strong
consistency.
See take_effects for example usage.
Trait Implementations§
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>
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 = VcCellCompareMode<Effects>
type CellMode = VcCellCompareMode<Effects>
Source§fn get_value_type_id() -> ValueTypeId
fn get_value_type_id() -> ValueTypeId
fn has_serialization() -> bool
impl Eq for Effects
impl NonLocalValue for Effects
impl Upcast<Box<dyn ValueDebug>> for Effects
impl UpcastStrict<Box<dyn ValueDebug>> for Effects
Auto Trait Implementations§
impl !Freeze for Effects
impl !RefUnwindSafe for Effects
impl Send for Effects
impl Sync for Effects
impl Unpin for Effects
impl UnsafeUnpin for Effects
impl !UnwindSafe 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> 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