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§
Sourcefn key(&self) -> Box<[u8]>
fn key(&self) -> Box<[u8]>
Unique key identifying this effect’s target (e.g., absolute path bytes).
Sourcefn value_hash(&self) -> u128
fn value_hash(&self) -> u128
Extract the hash of the value part of this effect for comparison.
Sourcefn apply<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ApplyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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.