Skip to main content

LocalExecutor

Trait LocalExecutor 

Source
pub trait LocalExecutor: Executor {
    // Required method
    fn spawn_local<F>(
        &self,
        future: F,
    ) -> Self::JoinHandle<<F as Future>::Output>
       where F: Future + 'static,
             <F as Future>::Output: 'static;
}
Expand description

A local executor which supports spawning non-Send futures.

Required Methods§

Source

fn spawn_local<F>(&self, future: F) -> Self::JoinHandle<<F as Future>::Output>
where F: Future + 'static, <F as Future>::Output: 'static,

Spawns the given non-Send future on this executor, returning a JoinHandle for the task.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl LocalExecutor for Scope

Source§

fn spawn_local<F>( &self, future: F, ) -> <Scope as Executor>::JoinHandle<<F as Future>::Output>
where F: Future + 'static, <F as Future>::Output: 'static,

Source§

impl LocalExecutor for ScopeHandle

Source§

fn spawn_local<F>( &self, future: F, ) -> <ScopeHandle as Executor>::JoinHandle<<F as Future>::Output>
where F: Future + 'static, <F as Future>::Output: 'static,

Implementors§