try_v2
A derive macro for try_trait_v2
Also enables auto-conversion from Result<T, E> where E: Into::into(Self)
Requires
RUSTC_BOOTSTRAP = 1(or nightly)#![feature(never_type)]#![feature(try_trait_v2)]
Current Limitations on the annotated type
- must be an
enum - must have one generic type
- the first and only generic type must be the
Outputtype (produced when not short circuiting) - the output variant (does not short-circuit) must be the first variant
- other (short-circuiting) variants can have at most one unnamed field
Example Usage
use Try;
assert!;
assert!;