Skip to main content

__mx_condition_parts

Macro __mx_condition_parts 

Source
#[doc(hidden)]
macro_rules! __mx_condition_parts { (@options class = $class:expr, call $($rest:tt)*) => { ... }; (@options class = $class:expr, data = $data:tt, call $($rest:tt)*) => { ... }; (@options data = $data:tt, call $($rest:tt)*) => { ... }; (@options class = $class:expr, data = $data:tt, $($arg:tt)*) => { ... }; (@options data = $data:tt, $($arg:tt)*) => { ... }; (@options class = $class:expr, $($arg:tt)*) => { ... }; (@options $($arg:tt)*) => { ... }; (@options call $($rest:tt)*) => { ... }; (@misplaced_call) => { ... }; (call = none, $($rest:tt)+) => { ... }; (call $($rest:tt)*) => { ... }; ($($rest:tt)*) => { ... }; }
Expand description

Internal: parse the shared option grid of error! / warning! / condition! and the defer_*! macros into (call, class, data, message). Not part of the public API.

Accepted orders (every part optional except the message): call = none, then class = .., then data = .., then the format! arguments. class takes anything implementing crate::condition::ConditionClass (one string or several). A call other than none, or one after class / data, is a compile error: a format! string must start with a literal, so call as the first token is never a message.

ⓘ
mx::warning!(call = wrapper, "no such call option");
ⓘ
mx::warning!(class = "pkg_warning", call = none, "`call` goes first");
mx::warning!(call = none, class = "pkg_warning", data = { n = 1 }, "plain");