SimpleSpawner

Trait SimpleSpawner 

Source
pub trait SimpleSpawner<R>:
    Debug
    + Send
    + Sync
    + 'static {
    type Error: Debug + Send + 'static;
    type Future: Future<Output = Result<R, Self::Error>> + Debug + Send + 'static;

    // Required methods
    fn spawn<F>(&self, task: F) -> Self::Future
       where F: Future<Output = R> + Send + 'static;
    fn is_done(f: &Self::Future) -> bool;
}
Expand description

Task spawner for SimpleResultReceiver.

Required Associated Types§

Source

type Error: Debug + Send + 'static

Source

type Future: Future<Output = Result<R, Self::Error>> + Debug + Send + 'static

Required Methods§

Source

fn spawn<F>(&self, task: F) -> Self::Future
where F: Future<Output = R> + Send + 'static,

Source

fn is_done(f: &Self::Future) -> bool

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.

Implementors§