Skip to main content

then

Function then 

Source
pub fn then<'a, T, U: 'a, E: 'a>(
    x: Result<T, E>,
    f: impl FnOnce(T) -> Results<'a, U, E>,
) -> Results<'a, U, E>
Expand description

If x is an Err, return it as iterator, else apply f to x and return its output.