Trait Task

Source
pub trait Task {
    type Output;

    // Required method
    fn call(&mut self) -> impl Future<Output = Self::Output>;
}

Required Associated Types§

Required Methods§

Source

fn call(&mut self) -> impl Future<Output = Self::Output>

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§

Source§

impl<T, F, O> Task for FnTask<T, F, O>
where T: FnMut() -> F, F: Future<Output = O>,

Source§

impl<T, O, E> Task for RetryTask<T>
where T: Task<Output = Result<O, E>>,

Source§

type Output = <T as Task>::Output