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 $(, name: $name:literal)?
9 $(, values: [$($value:literal),* $(,)?])?
10 $(, optional: $optional:literal)?
11 $(, nested: $nested:ty)?
12 $(, default: $default:ty)?
13 $(, list: $list:expr)?
14 $(, tagged_union: $tagged_union:expr)?
15 $(,)?
16 }
17 ),* $(,)?
18 }
19 ) => { ... };
20 (@name $field:ident) => { ... };
21 (@name $field:ident $name:literal) => { ... };
22 (@kind Boolean) => { ... };
23 (@kind String) => { ... };
24 (@kind Integer) => { ... };
25 (@kind Float) => { ... };
26 (@kind Enum) => { ... };
27 (@kind IntegerEnum) => { ... };
28 (@kind StringMap) => { ... };
29 (@kind Json) => { ... };
30 (@kind List) => { ... };
31 (@kind TaggedUnion) => { ... };
32 (@kind Section) => { ... };
33 (@values) => { ... };
34 (@values $($value:literal),*) => { ... };
35 (@optional) => { ... };
36 (@optional $optional:literal) => { ... };
37 (@nested) => { ... };
38 (@nested $nested:ty) => { ... };
39 (@default) => { ... };
40 (@default $default:ty) => { ... };
41 (@list) => { ... };
42 (@list $list:expr) => { ... };
43 (@tagged_union) => { ... };
44 (@tagged_union $tagged_union:expr) => { ... };
45}

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.