Crate code_path

Source
Expand description

§code-path

License Crates.io Docs.rs

A code path macro

§Usage


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

§Contributing

  • please run [.pre-commit.sh] before sending a PR, it will check everything

§License

This project is licensed under the MIT license.

Macros§

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

Structs§

CodePath
Represents path in the code