Trait pasts::Executor[][src]

pub trait Executor: Sized + Send + Sync + 'static {
    fn sleep(&self);

    fn wake(&self) { ... }
fn block_on_pinned<F>(self, future: F)
    where
        F: Future<Output = ()> + Unpin + 'static
, { ... }
fn block_on<F: Future<Output = ()> + 'static>(self, future: F) { ... } }
Expand description

Trait for implementing custom executors. Useful when targetting no-std.

Required methods

The sleep routine; should put the processor or thread to sleep in order to save CPU cycles and power, until the hardware tells it to wake up.

Provided methods

The wake routine; should wake the processor or thread. If the hardware is already waked up automatically, this doesn’t need to be implemented.

Block on an unpin future on the current thread.

Block on a future on the current thread (puts the future on the heap).

Implementors