mod config_editor#
- module config_editor#
Typed configuration editor metadata.
This module provides a small compile-time reflection surface for interactive configuration editors. Config structs use
editor_config!to expose ordered field metadata without making editor UIs depend on JSON Schema.Traits
- trait EditorConfig#
Trait implemented by configuration structs that expose editor metadata.
Functions
- fn editor_schema() -> &'static EditorSchema#
Returns the static editor schema for this config type.
Enums
- enum EditorFieldKind#
Editor control shape for one configuration field.
- Boolean#
Boolean toggle.
- String#
String-like value, including paths.
- Integer#
Integer value.
- Float#
Floating-point number value.
- Enum#
String enum with a fixed set of allowed values.
- StringMap#
Object with string keys and string values.
- Json#
Arbitrary JSON value.
- Section#
Nested configuration section.
Structs and Unions
- struct EditorFieldSpec#
Static editor metadata for one configuration field.
- name: &'static str#
Serialized field name.
- label: &'static str#
Human-readable label.
- kind: EditorFieldKind#
Editor control shape.
- enum_values: &'static [&'static str]#
Allowed string enum values, when
EditorFieldKind::Enumis used.
- optional: bool#
Whether the field is represented as an
Option<T>in Rust.
- nested_schema: Option<fn () -> &'static EditorSchema>#
Nested editor schema for section fields.
- nested_default: Option<fn () -> Json>#
Default value for a nested section.
Implementations
- impl EditorFieldSpec#
Functions
- fn default_value(self) -> Option<Json>#
Returns the typed default value for this field’s nested section.
- fn schema(self) -> Option<&'static EditorSchema>#
Returns the nested schema for this field, if it is a section.
- struct EditorSchema#
Static editor metadata for one configuration struct.
- fields: &'static [EditorFieldSpec]#
Ordered editor fields.
Implementations
- impl EditorSchema#
Functions
- fn field(self, name: &str) -> Option<EditorFieldSpec>#
Finds a field by serialized name.