FutureFactory

Trait FutureFactory 

Source
pub trait FutureFactory<In>
where In: 'static + Send, Self::Fut: 'static + Send + Future, <Self::Fut as Future>::Output: 'static + Send,
{ type Fut; // Required method fn generate(&mut self, input: In) -> Self::Fut; // Provided methods fn boxed<'a>( self, ) -> BoxFutureFactory<'a, In, <Self::Fut as Future>::Output> where Self: 'a + Sized + Send { ... } fn compose<G>(self, other: G) -> ComposeFutureFactory<In, Self, G> where Self: Sized, G: 'static + Send + Clone + FutureFactory<<Self::Fut as Future>::Output>, <G::Fut as Future>::Output: Send { ... } }

Required Associated Types§

Required Methods§

Source

fn generate(&mut self, input: In) -> Self::Fut

Provided Methods§

Source

fn boxed<'a>(self) -> BoxFutureFactory<'a, In, <Self::Fut as Future>::Output>
where Self: 'a + Sized + Send,

Source

fn compose<G>(self, other: G) -> ComposeFutureFactory<In, Self, G>
where Self: Sized, G: 'static + Send + Clone + FutureFactory<<Self::Fut as Future>::Output>, <G::Fut as Future>::Output: Send,

Implementors§

Source§

impl<F, In, Fut> FutureFactory<In> for F
where F: FnMut(In) -> Fut, In: 'static + Send, Fut: 'static + Send + Future, Fut::Output: 'static + Send,

Source§

type Fut = Fut

Source§

impl<In, F, G> FutureFactory<In> for ComposeFutureFactory<In, F, G>
where F: FutureFactory<In>, G: 'static + Send + Clone + FutureFactory<<F::Fut as Future>::Output>, In: 'static + Send, <F::Fut as Future>::Output: 'static + Send, <G::Fut as Future>::Output: 'static + Send, F::Fut: 'static + Send + Future, G::Fut: 'static + Send + Future,

Source§

type Fut = FutFacChain<<F as FutureFactory<In>>::Fut, G>