pub struct Runtime { /* private fields */ }
Expand description
An asynchronous Runtime.
Implementations
sourceimpl 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,
F: Send + 'static,
Fut: Future<Output = ()> + 'static,
pub fn spawn_pinned<F, Fut>(&self, create_task: F)where
F: FnOnce() -> Fut,
F: Send + 'static,
Fut: Future<Output = ()> + 'static,
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
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl !UnwindSafe for Runtime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more