- ssr double: page template composing header/footer partials under the
HTML escaper, typed context built by a builder fn per ADR-004; golden
pins for composition, escaping of hostile interpolation, the trusted
{{& }} slot, and render-by-partial-name rejection
- code double: struct-writer template under the no-op escaper, typed
context built from a schema document with kind mapping and
source-escaped literals in the builder; golden pins for document-order
arrays and the active preserve_order feature
- fixture assets are include_str! files under tests/fixtures/; fixture
modules are per-test-binary so wave-2 proofs can grow them
- task file updated to completed with Notes and Summary
Verification: cargo test green (19 lib + 8 fixture tests), clippy
-D warnings clean, cargo fmt --check clean
11 lines
280 B
Handlebars
11 lines
280 B
Handlebars
{{#each default_consts}}pub const {{const_name}}: &str = {{literal}};
|
|
{{/each}}
|
|
impl {{struct_name}} {
|
|
pub fn write<W: std::io::Write>(&self, out: &mut W) -> std::io::Result<()> {
|
|
{{#each fields}}
|
|
out.{{writer_call}}(&self.{{name}})?;
|
|
{{/each}}
|
|
Ok(())
|
|
}
|
|
}
|