Trait AsyncRecoverableFunction

Source
pub trait AsyncRecoverableFunction:
    Send
    + Sync
    + 'static {
    type Output: Send;
    type Future: Future<Output = Self::Output> + Send;

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

Trait alias for asynchronous functions that can be executed in a recoverable context.

  • Functions implementing this trait must return a Future and satisfy FnOnce() -> Future + Send + Sync + 'static.

Required Associated Types§

Source

type Output: Send

Source

type Future: Future<Output = Self::Output> + Send

Required Methods§

Source

fn call(self) -> Self::Future

Executes the asynchronous function.

Implementors§

Source§

impl<F, Fut, O> AsyncRecoverableFunction for F
where F: FnOnce() -> Fut + Send + Sync + 'static, Fut: Future<Output = O> + Send + 'static, O: Send + 'static,

Source§

type Output = O

Source§

type Future = Fut