pub fn try_map<'a, Projection, Output, NewType, Args, Descr>(
proj: Projection,
) -> Handler<'a, Output, Descr>Expand description
Constructs a fallible handler that passes a value of a new type further.
Like map, the result of invoking proj is added to the
container and passed further down the chain, but proj returns
Result<NewType, E>:
Ok(v):vis inserted into the container and the continuation is called.Err(e): the handler short-circuits and returnsControlFlow::Breakwith an error value built frome, without calling the continuation.
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.
See also: try_filter_map.