Expand description
Fluent builder for constructing AAML configuration content programmatically.
AAMBuilder accumulates lines in memory and can either return them as a
String or write them directly to a file. Useful in tests and code generators.
§High-level directive API
| Method | Directive emitted |
|---|---|
AAMBuilder::schema | @schema Name { ... } |
AAMBuilder::derive | @derive file.aam / @derive file.aam::A::B |
AAMBuilder::import | @import file.aam |
AAMBuilder::type_alias | @type alias = type |
AAMBuilder::comment | # ... |
§Example
use aam_core::builder::{AAMBuilder, SchemaField};
let mut b = AAMBuilder::new();
b.comment("Server configuration")
.type_alias("port_t", "i32")
.schema("Server", [
SchemaField::required("host", "string"),
SchemaField::required("port", "port_t"),
SchemaField::optional("debug", "bool"),
])
.add_line("host", "localhost")
.add_line("port", "8080");
let content = b.build();
assert!(content.contains("@schema Server {"));
assert!(content.contains("host = localhost"));Structs§
- AAMBuilder
- Accumulates AAML source lines and can flush them to a file or a
String. - Inline
Object - A builder for inline object literals
{ key = value, ... }. - Schema
Field - A single field declaration inside a
@schemablock.
Enums§
- Built
InType - Enumeration of all built-in AAML types for use with the Builder API.
Functions§
- parse_
inline_ to_ map - Parses an inline object string
{ key = value, ... }into aHashMap<String, String>.