[][src]Macro join::try_join

macro_rules! try_join {
    #[proc_macro_hack(support_nested)] => { ... };
}

Use to combine results. It transposes tuple of Results/Options into Result/Option of tuple or single Result/Option in case of 1 branch.

Example:

extern crate join;

use join::try_join;

fn main() {
    let product = try_join! {
        Ok::<_,()>(2) |> |v| v + 2,
        Ok::<_,()>(3),
        Ok::<_,()>(4),
        map => |a, b, c| a * b * c
    }.unwrap();

    assert_eq!(product, 48);
}