Skip to main content

EffectInvoker

Trait EffectInvoker 

Source
pub trait EffectInvoker: Send + Sync {
    // Required method
    fn invoke<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        effect_name: &'life1 str,
        inputs: &'life2 Value,
        model_version: &'life3 str,
        sampling: &'life4 SamplingParams,
    ) -> Pin<Box<dyn Future<Output = Result<Value, EffectInvokerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
}
Expand description

What the adopter plugs in. Given the replay inputs + model/sampling context, produce the effect’s output value.

Implementations should be deterministic for deterministic effects (DB reads against a snapshot, pure transformations) and honour sampling.seed for LLM inference. Non-seedable providers return an EffectInvokerError::NonReplayable so the executor’s divergence report pinpoints the cause.

Required Methods§

Source

fn invoke<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, effect_name: &'life1 str, inputs: &'life2 Value, model_version: &'life3 str, sampling: &'life4 SamplingParams, ) -> Pin<Box<dyn Future<Output = Result<Value, EffectInvokerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§