Skip to main content

Crate tomlmenu_derive

Crate tomlmenu_derive 

Source
Expand description

Schema derive — emits a static MenuNode tree describing the annotated type’s editable surface.

Output paths resolve as ::tomlmenu::*. The derive is therefore valid in any crate whose dependency graph includes tomlmenu.

Attribute vocabulary:

  • #[tomlmenu(label = "...")] — display name; optional, defaults to the serde-resolved field name.
  • #[tomlmenu(help = "...")] — help-pane text; optional, defaults to "<no help>".
  • #[tomlmenu(skip)] — exclude from menu; serde behaviour unchanged.

Field type classification:

  • bool / Option<bool>LeafKind::Bool.
  • Primitive unsigned int (u8..u64) or its Option<...> wrapper → LeafKind::UInt { min: 0, max: T::MAX as u64 }.
  • String / Option<String>LeafKind::Text.
  • Enum-typed field → recurses into the enum’s own Schema impl, yielding LeafKind::Choice(&[variants...]) at emission.
  • Vec<...> (outer) and Option<Vec<...>> (inner) → reject with compile_error! unless #[tomlmenu(skip)] is set.

Derive Macros§

Schema