Crates.io | trace_caller |
lib.rs | trace_caller |
version | 0.2.0 |
source | src |
created_at | 2020-03-19 17:11:14.438542 |
updated_at | 2020-03-21 02:52:26.119943 |
description | Trace the location of caller of a function. |
homepage | |
repository | https://github.com/ayushmishra2005/trace_caller |
max_upload_size | |
id | 220509 |
size | 7,978 |
This procedural attribute macro will allow retrieving the caller's source location in the stable Rust. Rust has also this feature, but it is currently unstable and available in nightly-only build. But with this attribute, you can use this feature on stable Rust.
It will help to trace the location of the caller of a function.
use trace_caller::trace;
#[trace]
fn add(x: u32, y: u32) -> u32 {
x + y
}
fn main() {
let result = add(3, 4);
println!("Result: {}", result);
}
Called from "src/main.rs" at line 11
Result: 7