Crate try_blocks

Source
Expand description

§Notice

This crate has been moved/renamed to tryvial. You should use that instead.


Macro for stable try blocks that performs Ok-wrapping, and otherwise tries to achieve feature parity with RFC 1859. The macro is compatible with any type that implements the unstable Try trait through the use of type magic.

This crate is no_std compatible.

Macros§

try_block
Macro for the recieving end of a ? operation. Right now, type inference is quite finicky so you usually have to declare a concrete type somewhere.
try_cf
Like try_block, but specificially for [ControlFlow]. This aids type inference.
try_opt
Like try_block, but specificially for Option. This aids type inference.
try_res
Like try_block, but specificially for Result]. This aids type inference.
wrap_ok
Macro for ok-wrapping any Try type. This works on stable through dark type magic.