Skip to main content

in_context

Macro in_context 

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

Macro for running code within a context scope.

§Example

ⓘ
let context = extract_from_headers(&headers);
in_context!(context, {
    // Code here runs with the context attached
    let span = span!("my_operation");
});