Skip to main content

Module schema_gen

Module schema_gen 

Source
Expand description

Schema loading and Rust codegen for the Datadog agent config schema.

Parses core_schema.yaml (with any overlay applied upstream) into a flat map of yaml_path → FieldInfo, then emits schema.rs containing one SchemaEntry constant per config key. Used exclusively at build time.

The schema may contain $ref: <filename> entries that reference subsystem schema files in the same directory. These are resolved and inlined during loading.

Structs§

FieldInfo
Parsed metadata for a single config field.

Enums§

FieldType
Value type of a config field, as declared in the schema YAML.

Functions§

escape_str
Escape backslashes and double-quotes in s for use inside a Rust string literal.
field_type_as_rust
Return the ValueType::* token string for use in generated Rust source.
generate_schema_rs
Generate schema.rs in dir from schema_map.
is_unknown
Return true if ft is FieldType::Unknown.
load_schema
Load and flatten the schema at schema_path into a yaml_path → FieldInfo map.
yaml_path_to_const
Convert a dotted YAML path (for example, "dogstatsd.bind_host") to a SCREAMING_SNAKE_CASE Rust identifier suitable for a const name.