pub fn try_filter_map<'a, Projection, Output, NewType, Args, Descr>(
proj: Projection,
) -> Handler<'a, Output, Descr>Expand description
Constructs a fallible handler that optionally passes a value of a new type further.
Like filter_map, proj may add a value to the
container, but it returns Result<Option<NewType>, E>:
Ok(Some(v)):vis inserted into the container and the continuation is called.Ok(None): the handler returnsControlFlow::Continue(it tries the next branch), just likefilter_mapreturningNone.Err(e): the handler short-circuits and returnsControlFlow::Breakwith an error value built frome.
The handler Output must be fallible (i.e. implement Fallible); in
practice this means it is a Result<T, E>, and E is the error type that
proj returns on failure.