Trait Task

Source
pub trait Task {
    type Item;
    type Error: Debug;
    type Fut: Future<Output = Result<Self::Item, Self::Error>>;

    // Required method
    fn call(&mut self) -> Self::Fut;
}
Expand description

A unit of work to be retried

A implementation is provided for FnMut() -> Future

Required Associated Types§

Source

type Item

The Ok variant of a Futures associated Output type

Source

type Error: Debug

The Err variant of Futures associated Output type

Source

type Fut: Future<Output = Result<Self::Item, Self::Error>>

The resulting Future type

Required Methods§

Source

fn call(&mut self) -> Self::Fut

Call the operation which invokes results in a Future

Implementors§

Source§

impl<F, Fut, I, E> Task for F
where F: FnMut() -> Fut, Fut: Future<Output = Result<I, E>>, E: Debug,

Source§

type Item = I

Source§

type Error = E

Source§

type Fut = Fut