[][src]Trait pulsar::executor::Executor

pub trait Executor: Clone + Send + Sync + 'static {
    fn spawn(
        &self,
        f: Pin<Box<dyn Future<Output = ()> + Send>>
    ) -> Result<(), ()>;
fn spawn_blocking<F, Res>(&self, f: F) -> JoinHandle<Res>

Important traits for JoinHandle<T>

impl<T> Future for JoinHandle<T> type Output = Option<T>;

    where
        F: FnOnce() -> Res + Send + 'static,
        Res: Send + 'static
;
fn interval(&self, duration: Duration) -> Interval;
fn delay(&self, duration: Duration) -> Delay

Important traits for Delay

impl Future for Delay type Output = ();
;
fn kind(&self) -> ExecutorKind; }

Wrapper trait abstracting the Tokio and async-std executors

Required methods

fn spawn(&self, f: Pin<Box<dyn Future<Output = ()> + Send>>) -> Result<(), ()>

fn spawn_blocking<F, Res>(&self, f: F) -> JoinHandle<Res>

Important traits for JoinHandle<T>

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

fn interval(&self, duration: Duration) -> Interval

fn delay(&self, duration: Duration) -> Delay

Important traits for Delay

impl Future for Delay type Output = ();

fn kind(&self) -> ExecutorKind

Loading content...

Implementations on Foreign Types

impl<Exe: Executor> Executor for Arc<Exe>[src]

Loading content...

Implementors

impl Executor for AsyncStdExecutor[src]

impl Executor for TokioExecutor[src]

Loading content...