Skip to main content

Effect

Trait Effect 

Source
pub trait Effect:
    Send
    + Sync
    + NonLocalValue
    + ValueDebug {
    // Required method
    fn capture<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn CapturedEffect>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

An IO Side effect to be computed by turbo tasks and then executed outside of turbo tasks.

Required Methods§

Source

fn capture<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn CapturedEffect>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read any Vc data needed for apply() and return the CapturedEffect that performs it.

An implementation may elect to elide capturing data if the EffectStateStorage state is already up to date.

Trait Implementations§

Source§

impl VcValueTrait for Box<dyn Effect>

Source§

const IMPL_VTABLES: &'static VTableRegistry<Self::ValueTrait>

The per-trait vtable registry, populated by [crate::value_type::register_all_trait_methods] Read more
Source§

type ValueTrait = dyn Effect

Source§

fn get_trait_type_id() -> TraitTypeId

Returns the type id of the trait object.
Source§

impl Dynamic<Box<dyn Effect>> for Box<dyn Effect>

Source§

impl Dynamic<Box<dyn ValueDebug>> for Box<dyn Effect>

Available on debug-assertions enabled only.
Source§

impl Upcast<Box<dyn Effect>> for Box<dyn Effect>

Source§

impl Upcast<Box<dyn ValueDebug>> for Box<dyn Effect>

Available on debug-assertions enabled only.
Source§

impl UpcastStrict<Box<dyn ValueDebug>> for Box<dyn Effect>

Available on debug-assertions enabled only.

Implementors§

Source§

impl<T> Effect for T