Skip to main content

Interpret

Trait Interpret 

Source
pub trait Interpret {
    type Effect;

    // Required method
    fn run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        scope: &'life1 Scope,
        effect: Self::Effect,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Bytes>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Runs the effects produced by a protocol’s pure step. run returns the payloads to re-inject into the router; each is re-delivered to this protocol’s own namespace with from = this node — the router sets the provenance, so a shell can forge neither a namespace nor a remote from. A hard failure is an Err. Defined per-effect outcomes (e.g. “addressed no live session”) are the extension’s own concern and surfaced however it likes (its own return shapes / tests), not a core enum.

Required Associated Types§

Source

type Effect

The effect algebra this shell interprets — the same as its protocol’s Effect.

Required Methods§

Source

fn run<'life0, 'life1, 'async_trait>( &'life0 self, scope: &'life1 Scope, effect: Self::Effect, ) -> Pin<Box<dyn Future<Output = Result<Vec<Bytes>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run one effect against the scoped capability, returning self-injected payloads (each re-decoded by this same protocol).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§