Skip to main content

__mx_condition_data

Macro __mx_condition_data 

Source
#[doc(hidden)]
macro_rules! __mx_condition_data { (($name:literal, $value:expr $(,)?)) => { ... }; (($name:expr, $value:expr $(,)?)) => { ... }; ([ $($pair:tt),* $(,)? ]) => { ... }; ({ $($name:ident = $value:expr),* $(,)? }) => { ... }; }
Expand description

Internal: normalise a macro data = ... argument into Option<ConditionData>. Not part of the public API.

Three forms are accepted:

  • a single pair: ("name", value)
  • a bracketed list of pairs: [("a", v1), ("b", v2)]
  • keyed builder sugar: { name = value, other = value } — the field name is a bare identifier (stringified by the macro), so { value = 42, code = 7 } is shorthand for [("value", 42), ("code", 7)].

Each value is converted via RValue::from, so any type with an RValue From impl (the scalar/vector/Option/wide-integer set, and tuples of those as unnamed lists) works without ceremony.

Field names are checked against the condition’s own slots (message / call / kind): at compile time when the name is a literal or bare identifier, at runtime otherwise.