Skip to main content

try_with_context

Macro try_with_context 

Source
macro_rules! try_with_context {
    ($context:expr, $expr:expr) => { ... };
}
Expand description

Helper macro for use within map_with_context as an alternative to “trying” an expression.

§Example

Problem: expr? won’t work because the expected return type is (Result<R, AmlError>, &mut AmlContext) Solution: use try_with_context!(context, expr) instead.