pub trait RuntimeExt: Runtime {
// Provided methods
fn spawn<F>(&self, future: F)
where F: Future<Output = ()> + 'static { ... }
fn core(&self, placement: impl Into<Placement>) -> OnCore<'_, Self> { ... }
fn blocking<R, W>(&self, work: W) -> Blocking<'_, Self, W, R>
where R: Send + 'static,
W: FnOnce() -> Result<R, ProximaError> + Send + 'static { ... }
}Expand description
Fluent spawn surface. Blanket-implemented for every Runtime; never used
as dyn itself, which is what buys back the generics.
Provided Methods§
Sourcefn spawn<F>(&self, future: F)
fn spawn<F>(&self, future: F)
Spawn a future on the current core. The trait’s own
spawn_on_current_core discards a SpawnError that spawn_on_core
surfaces — this keeps that discard where the caller can see it.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".