Macro editor_config

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

1macro_rules! editor_config {
2 (
3 impl $ty:ty {
4 $(
5 $field:ident => {
6 label: $label:literal,
7 kind: $kind:ident
8 $(, values: [$($value:literal),* $(,)?])?
9 $(, optional: $optional:literal)?
10 $(, nested: $nested:ty)?
11 $(, default: $default:ty)?
12 $(, list: $list:expr)?
13 $(, tagged_union: $tagged_union:expr)?
14 $(,)?
15 }
16 ),* $(,)?
17 }
18 ) => { ... };
19 (@kind Boolean) => { ... };
20 (@kind String) => { ... };
21 (@kind Integer) => { ... };
22 (@kind Float) => { ... };
23 (@kind Enum) => { ... };
24 (@kind StringMap) => { ... };
25 (@kind Json) => { ... };
26 (@kind List) => { ... };
27 (@kind TaggedUnion) => { ... };
28 (@kind Section) => { ... };
29 (@values) => { ... };
30 (@values $($value:literal),*) => { ... };
31 (@optional) => { ... };
32 (@optional $optional:literal) => { ... };
33 (@nested) => { ... };
34 (@nested $nested:ty) => { ... };
35 (@default) => { ... };
36 (@default $default:ty) => { ... };
37 (@list) => { ... };
38 (@list $list:expr) => { ... };
39 (@tagged_union) => { ... };
40 (@tagged_union $tagged_union:expr) => { ... };
41}

Implements EditorConfig for a configuration type.

This macro intentionally keeps editor metadata next to the Rust config type while avoiding proc-macro reflection. Field order is declaration order inside the macro invocation.