Get the Location of a Calling Function in Rust
September 2025
Use and caller to get the file and location of where a funciton was called.
Output:
Caller: example.rs:2:3
Caller: example.rs:7:3
end of line
References
The page where I found out how to do this.