use crate::{ data, fut::Fut, handling::{Apply, Handler}, }; #[data(copy, ord, crate = crate)] pub struct Then { pub lhs: L, pub rhs: R, } impl Handler for Then where R: Send + Sync, L: for<'a> Handler, Output = Output>, { type Output = Output; fn call(&self, state: S, in_: I, next: N) -> impl Fut { self.lhs.call(state, in_, Apply::new(&self.rhs, next)) } } impl Then { pub const fn new(lhs: L, rhs: R) -> Self { Self { lhs, rhs } } }