Macro stdext::debug_name

source ·
macro_rules! debug_name {
    () => { ... };
}
Expand description

This macro returns the name of the enclosing function, line number and also filename. As the internal implementation is based on the std::any::type_name, this macro derives all the limitations of this function.

§Examples

mod bar {
    pub fn sample_function() {
        use stdext::debug_name;
        assert!(debug_name!().starts_with("src/macros.rs:8"));
        assert!(debug_name!().ends_with("bar::sample_function"));
    }
}

bar::sample_function();