Trait Then

Source
pub trait Then<'a, A, B, C, F, R> {
    // Required method
    fn then(self, f: F) -> R;
}
Expand description

trait Then allows you to compose functions. Type param A represents the function arg of Self

Type param B represents the return type of Self

Type B also acts as the input arg of function f

Type C represents the return type of function f

Required Methods§

Source

fn then(self, f: F) -> R

Compose self with function f

self:function(A)->B

f:function(B)->C

returns function(A)->C

Implementors§

Source§

impl<'a, T1: 'a + Send, T2: 'a + Send, T3: 'a, E1: Send + 'a, E2> Then<'a, T1, T2, T3, Box<dyn FnOnce(T2) -> Result<T3, E2> + Sync + Send + 'a>, Box<dyn FnOnce(T1) -> Result<T3, E2> + Sync + Send + 'a>> for BoxedFn1<'a, T1, T2, E1>
where E2: From<E1> + Send + 'a,

Then implementation for composing sync function (BoxedFn1) with another sync function(BoxedFn1)

Source§

impl<'a, T1: 'a + Send, T2: 'a + Send, T3: 'a, E1: Send + 'a, E2> Then<'a, T1, T2, T3, Box<dyn FnOnce(T2) -> Result<T3, E2> + Sync + Send + 'a>, Box<dyn FnOnce(T1) -> Pin<Box<dyn Future<Output = Result<T3, E2>> + Send + 'a>> + Sync + Send + 'a>> for BoxedAsyncFn1<'a, T1, T2, E1>
where E2: From<E1> + Send + 'a,

Then implementation for composing async function(BoxedAsyncFn1) with another sync function(BoxedFn1)

Source§

impl<'a, T1: 'a + Send, T2: 'a + Send, T3: 'a, E1: Send + 'a, E2> Then<'a, T1, T2, T3, Box<dyn FnOnce(T2) -> Pin<Box<dyn Future<Output = Result<T3, E2>> + Send + 'a>> + Sync + Send + 'a>, Box<dyn FnOnce(T1) -> Pin<Box<dyn Future<Output = Result<T3, E2>> + Send + 'a>> + Sync + Send + 'a>> for BoxedAsyncFn1<'a, T1, T2, E1>
where E2: From<E1> + Send + 'a,

Then implementation for composing async function(BoxedAsyncFn1) with another async function(BoxedAsyncFn1)

Source§

impl<'a, T1: 'a + Send, T2: 'a + Send, T3: 'a, E1: Send + 'a, E2> Then<'a, T1, T2, T3, Box<dyn FnOnce(T2) -> Pin<Box<dyn Future<Output = Result<T3, E2>> + Send + 'a>> + Sync + Send + 'a>, Box<dyn FnOnce(T1) -> Pin<Box<dyn Future<Output = Result<T3, E2>> + Send + 'a>> + Sync + Send + 'a>> for BoxedFn1<'a, T1, T2, E1>
where E2: From<E1> + Send + 'a,

Then implementation for composing sync function(BoxedFn1) with another async function(BoxedAsyncFn1)