sp_tracing

Macro span

source
macro_rules! span {
    (target: $target:expr, parent: $parent:expr, $lvl:expr, $name:expr) => { ... };
    (target: $target:expr, parent: $parent:expr, $lvl:expr, $name:expr, $($fields:tt)*) => { ... };
    (target: $target:expr, $lvl:expr, $name:expr, $($fields:tt)*) => { ... };
    (target: $target:expr, parent: $parent:expr, $lvl:expr, $name:expr) => { ... };
    (parent: $parent:expr, $lvl:expr, $name:expr, $($fields:tt)*) => { ... };
    (parent: $parent:expr, $lvl:expr, $name:expr) => { ... };
    (target: $target:expr, $lvl:expr, $name:expr, $($fields:tt)*) => { ... };
    (target: $target:expr, $lvl:expr, $name:expr) => { ... };
    ($lvl:expr, $name:expr, $($fields:tt)*) => { ... };
    ($lvl:expr, $name:expr) => { ... };
}
Expand description

Constructs a new span.

See the top-level documentation for details on the syntax accepted by this macro.

ยงExamples

Creating a new span:

let span = span!(Level::TRACE, "my span");
let _enter = span.enter();
// do work inside the span...