pub fn try_and<S, E, T>(
handlers: T,
) -> impl Handler<S, E, Output = <T::Combinator as Handler<S, E>>::Output>where
T: TryAndChain<S, E>,
Expand description
Executes the handlers in a tuple or Vec
in order until a handler does not match the event
or returns an error. If a handler matches but returns an error, the error is returned. If all
handlers match and no handlers return an error, then the output of the last handler in the
sequence is returned, otherwise Handled::Unmatched
.
The output type must implement Try
and the residual of the output must be the same for all
handlers (the error types must be compatible).