Skip to main content

FutureFn

Trait FutureFn 

Source
pub trait FutureFn<T>:
    Fn() -> FutureBox<T>
    + Send
    + Sync { }
Expand description

A trait for thread-safe, reference-counted closures that produce a boxed future.

This trait is used for storing and executing asynchronous operations that need to be sendable across threads, such as in the server’s request processing pipeline.

Implementors§

Source§

impl<T, O> FutureFn<O> for T
where T: Fn() -> FutureBox<O> + Send + Sync,

Blanket implementation of FutureFn for any type that satisfies the bounds.