[−][src]Crate code_location
code_location
A library to automatically acquire a code location in a rust source code file.
The library provides the code_location!() macro.
The macro expands to the CodeLocation struct
by combining the standard file!(), line!() and column!() macros.
Examples
use code_location::code_location; println!("I am printing from {}", code_location!()); assert_eq!(code_location!().to_string(), "src/lib.rs:7:12");
use code_location::{code_location, CodeLocation}; let code_location: CodeLocation = code_location!(); assert_eq!(code_location.file, "src/lib.rs"); assert_eq!(code_location.line, 6); assert_eq!(code_location.column, 35);
#![no_std]
code_location only depends on the core library.
Macros
| code_location | Expands to the |
Structs
| CodeLocation | A CodeLocation type to represent a certain point in a source code text file. |