Skip to main content

CapturedEffect

Trait CapturedEffect 

Source
pub trait CapturedEffect:
    TraceRawVcs
    + NonLocalValue
    + Send
    + Sync
    + 'static {
    // Required methods
    fn key(&self) -> Box<[u8]>;
    fn value_hash(&self) -> u128;
    fn apply<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), ApplyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Post-capture effect. Holds data needed to perform the actual side effect in a top level context.

apply() is responsible for coordinating with EffectStateStorage via EffectStateStorage::run_apply (which handles the per-key state machine, in-progress coordination, dedup-hit short-circuit, and panic recovery).

Required Methods§

Source

fn key(&self) -> Box<[u8]>

Unique key identifying this effect’s target (e.g., absolute path bytes).

Source

fn value_hash(&self) -> u128

Extract the hash of the value part of this effect for comparison.

Source

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

Perform the side effect

Implementations typically dispatch into EffectStateStorage::run_apply.

Implementors§