Macro async_backtrace::location
source · macro_rules! location {
() => { ... };
}
Expand description
Produces a Location
when invoked in a function body.
use async_backtrace::{location, Location};
#[tokio::main]
async fn main() {
assert_eq!(location!().to_string(), "rust_out::main::{{closure}} at backtrace/src/location.rs:8:16");
async {
assert_eq!(location!().to_string(), "rust_out::main::{{closure}}::{{closure}} at backtrace/src/location.rs:11:20");
}.await;
(|| async {
assert_eq!(location!().to_string(), "rust_out::main::{{closure}}::{{closure}}::{{closure}} at backtrace/src/location.rs:15:20");
})().await;
}