[][src]Trait agnostik::AgnostikExecutor

pub trait AgnostikExecutor {
    fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>

Important traits for JoinHandle<R>

impl<R> Future for JoinHandle<R> where
    R: 'static + Send
type Output = R;

    where
        F: Future + Send + 'static,
        F::Output: Send + 'static
;
fn spawn_blocking<F, T>(&self, task: F) -> JoinHandle<T>

Important traits for JoinHandle<R>

impl<R> Future for JoinHandle<R> where
    R: 'static + Send
type Output = R;

    where
        F: FnOnce() -> T + Send + 'static,
        T: Send + 'static
;
fn block_on<F>(&self, future: F) -> F::Output
    where
        F: Future + Send + 'static,
        F::Output: Send + 'static
; }

This trait represents a generic executor that can spawn a future, spawn a blocking task, and wait for a future to finish.

Required methods

fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>

Important traits for JoinHandle<R>

impl<R> Future for JoinHandle<R> where
    R: 'static + Send
type Output = R;
where
    F: Future + Send + 'static,
    F::Output: Send + 'static, 

Spawns an asynchronous task using the underlying executor.

fn spawn_blocking<F, T>(&self, task: F) -> JoinHandle<T>

Important traits for JoinHandle<R>

impl<R> Future for JoinHandle<R> where
    R: 'static + Send
type Output = R;
where
    F: FnOnce() -> T + Send + 'static,
    T: Send + 'static, 

Runs the provided closure on a thread, which can execute blocking tasks asynchronously.

fn block_on<F>(&self, future: F) -> F::Output where
    F: Future + Send + 'static,
    F::Output: Send + 'static, 

Blocks until the future has finished.

Loading content...

Implementors

impl AgnostikExecutor for BastionExecutor[src]

Loading content...