Trait caller_modpath::CallerModpath[][src]

pub trait CallerModpath {
    fn caller_modpath() -> String;
}

Provides a way to fetch the module path of the caller.

Note:

#[expose_caller_modpath] must be placed on the parent #[proc_macro_attribute] to enable. caller_modpath may be called from children functions, so long as #[expose_caller_modpath] is applied to the parent.

Required methods

fn caller_modpath() -> String[src]

Get the caller modpath.

Fetching is done lazily and cahced into a static. So, the first call will be slow and subsequent calls will be much faster.

Loading content...

Implementations on Foreign Types

impl CallerModpath for Span[src]

impl CallerModpath for Span[src]

This impl is for proc_macro2::Span. The backend is the exact same; this is just provided for convienience.

Loading content...

Implementors

Loading content...