- code-shaped fixture set: writer + validator template kinds over one composed partial, no-op escaper, strict mode, all public API - ADR-004 mappings in builder Rust (kind->call names, struct name, string-kind flag, source-quoted literals); templates stay dumb - document order (not sort/hash/reverse) drives rendered order; reordered arrays render in the array's new order - determinism: byte-identical across repeated renders, registry rebuilds, differing registration orders, fresh contexts, and both sinks (render vs render_to_write) - banner stays an emit-layer obligation; no banner assertions in the proof (gap recorded in task Notes, honestly) Verification: cargo test (38 passed), cargo clippy --all-targets -- -D warnings, cargo fmt --check, taskgraph validate
9 lines
261 B
Handlebars
9 lines
261 B
Handlebars
impl {{struct_name}} {
|
|
pub fn validate(&self) -> Result<(), &'static str> {
|
|
{{#each fields}}
|
|
{{#if is_string}} check_str_len(&self.{{name}}, {{max_len_const}})?;{{else}} {{check_call}}(&self.{{name}})?;{{/if}}
|
|
{{/each}}
|
|
Ok(())
|
|
}
|
|
}
|