Trait ExecutorTrait

Source
pub(crate) trait ExecutorTrait {
    // Required methods
    fn async_from<'a, F: IntoAsync + 'a>(
        &self,
        f: F,
    ) -> AsyncResult<IoSource<F>>;
    fn spawn<F>(&self, f: F) -> TaskHandle<F::Output> 
       where F: Future + Send + 'static,
             F::Output: Send + 'static;
    fn spawn_blocking<F, R>(&self, f: F) -> TaskHandle<R> 
       where F: FnOnce() -> R + Send + 'static,
             R: Send + 'static;
    fn spawn_local<F>(&self, f: F) -> TaskHandle<F::Output> 
       where F: Future + 'static,
             F::Output: 'static;
    fn run_until<F: Future>(&self, f: F) -> AsyncResult<F::Output>;
}

Required Methods§

Source

fn async_from<'a, F: IntoAsync + 'a>(&self, f: F) -> AsyncResult<IoSource<F>>

Source

fn spawn<F>(&self, f: F) -> TaskHandle<F::Output>
where F: Future + Send + 'static, F::Output: Send + 'static,

Source

fn spawn_blocking<F, R>(&self, f: F) -> TaskHandle<R>
where F: FnOnce() -> R + Send + 'static, R: Send + 'static,

Source

fn spawn_local<F>(&self, f: F) -> TaskHandle<F::Output>
where F: Future + 'static, F::Output: 'static,

Source

fn run_until<F: Future>(&self, f: F) -> AsyncResult<F::Output>

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<Re: Reactor + 'static> ExecutorTrait for Arc<RawExecutor<Re>>

Source§

fn async_from<'a, F: IntoAsync + 'a>(&self, f: F) -> AsyncResult<IoSource<F>>

Source§

fn spawn<F>(&self, f: F) -> TaskHandle<F::Output>
where F: Future + Send + 'static, F::Output: Send + 'static,

Source§

fn spawn_local<F>(&self, f: F) -> TaskHandle<F::Output>
where F: Future + 'static, F::Output: 'static,

Source§

fn spawn_blocking<F, R>(&self, f: F) -> TaskHandle<R>
where F: FnOnce() -> R + Send + 'static, R: Send + 'static,

Source§

fn run_until<F: Future>(&self, f: F) -> AsyncResult<F::Output>

Implementors§