pub trait AsyncDispatcher: Send + Sync {
// Required method
fn dispatch<'life0, 'life1, 'async_trait>(
&'life0 self,
ref_: &'life1 str,
input: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, EvalError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Async dispatcher trait — async 版 Dispatcher。
async_trait macro 経由 (= Rust 2021 互換 + dyn safe)。 Host crate
(e.g. mlua-swarm-engine AsyncSpawner) が impl する。 substrate には
tokio dep 入れない (= Pure 維持)、 executor は caller (host) 責務。
Required Methods§
fn dispatch<'life0, 'life1, 'async_trait>(
&'life0 self,
ref_: &'life1 str,
input: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, EvalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".