Macro context

Source
macro_rules! context {
    (parent: $parent:expr $(, $($fields:tt)*)?) => { ... };
    ($($fields:tt)*) => { ... };
}
Expand description

Create a new context with the given fields.

The fields are specified as a comma-separated list of key = value pairs. Field values can be any type that implements the ToValue trait.

A parent context can be specified with parent: <parent>.

ยงExamples

let a = context!(foo = 1, bar = "baz");
let b = context!(parent: a, foo = 2);
let c = context!(parent: None, foo = 3);