Derive Macro lunatic_macros::ProcessName

source ·
#[derive(ProcessName)]
{
    // Attributes available to this derive:
    #[lunatic]
}
Expand description

ProcessName implements the lunatic::ProcessName trait by generating a unique name in the following format:

"<pkg_name>@<pkg_version>::<module_path>::<ident>"

Example

#[derive(ProcessName)]
struct LoggingProcess;

assert_eq!(LoggingProcess.process_name(), "lunatic@0.12.1::logging::LoggingProcess");

The process name can be overridden with the #[lunatic(process_name = "...")] attribute.

#[derive(ProcessName)]
#[lunatic(process_name = "global_logging_process")]
struct LoggingProcess;

assert_eq!(LoggingProcess.process_name(), "global_logging_process");