Crate code_path

source ·
Expand description

code-path

A code path macro

Usage


fn foo() {
    fn bar() {
        assert_eq!(
            code_path!(),
            "rust_out::main::_doctest_main_src_lib_rs_6_0::foo::bar, src/lib.rs:10:13".into(),
        );
    }
    bar()
}
foo()

Macros

  • Returns the code location: file_name:line:column
  • Returns the current code scope with location, e.g. code_path::tests::scope_path::foo::bar, src/lib.rs:80:17
  • Returns the current scope path, e.g. my_crate::my_module::my_function)

Structs