pub trait AsyncRuntime {
type T;
// Required method
fn spawn<Fn, F>(&self, f: Fn) -> TaskHandle
where Fn: FnOnce(Self::T) -> F + Send + 'static,
F: Future<Output = ()> + Send + 'static;
}Expand description
Executor for async service methods.
The associated type T is a per-call context passed into the
spawned future and retrievable via Async::context. Use () if no
extra context is needed.
See the rt module for a ready-made Tokio implementation
or implement this trait directly for a custom executor.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".