try_flow

Macro try_flow 

Source
macro_rules! try_flow {
    (log $n:ident: $x:expr) => { ... };
    ($x:expr) => { ... };
}
Expand description

Use event_flow! instead.

Returns from the current function if the block returns a value for which [ConsumedEvent::is_consumed] == true.

This breaks the control-flow of the current function effectively.

As the return type of the current function can differ from whatever function has been called, an ìnto() conversion is thrown in too.

The difference to flow is that this one Ok-wraps the result.

Extras: If you add a marker as in try_flow!(log ident: {...}); the result of the operation is written to the log.