[]Trait bastion::io::prelude::AgnostikExecutor

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

Notable traits for JoinHandle<R>

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

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

Notable 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 as Future>::Output
    where
        F: Future + Send + 'static,
        <F as Future>::Output: Send,
        <F as Future>::Output: '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 as Future>::Output>

Notable traits for JoinHandle<R>

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

Spawns an asynchronous task using the underlying executor.

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

Notable 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 as Future>::Output where
    F: Future + Send + 'static,
    <F as Future>::Output: Send,
    <F as Future>::Output: 'static, 

Blocks until the future has finished.

Loading content...

Implementors

impl AgnostikExecutor for BastionExecutor

Loading content...