pub struct Runtime { /* private fields */ }
Expand description
An asynchronous Runtime.
Implementations§
source§impl Runtime
impl Runtime
sourcepub fn builder() -> RuntimeBuilder
pub fn builder() -> RuntimeBuilder
Creates a runtime Builder.
sourcepub fn spawn_pinned<F, Fut>(&self, create_task: F)where
F: FnOnce() -> Fut + 'static + Send,
Fut: 'static + Future<Output = ()>,
pub fn spawn_pinned<F, Fut>(&self, create_task: F)where
F: FnOnce() -> Fut + 'static + Send,
Fut: 'static + Future<Output = ()>,
Spawns a task with it pinned to a worker thread.
This can be used to execute non-Send futures without blocking the current thread.
spawn_local
is available with tasks executed with spawn_pinned
.