Expand description
Unified report: block — plots and tables under one schema.
See SRD-46 (docs/SRD/46_reports.md) for the authoritative
design. This module owns:
- The data model:
Report/ReportGroup/ReportItem/Kind/Style. - The directive-string tokenizer that splits a group’s body
into items keyed by leading
plot <name>/table <name>. - The JSON sub-block parser for
series ... {…}style overrides (strict JSON only — relies on the existing rule that Polydat{...}is unambiguously not JSON). - Style cascade helpers:
defaultsat workload root,defaultsat group level, then per-item directives.
The crate is parser-only. Renderers in crates/nmbrs/src/plot_metrics.rs
and the corresponding table renderer consume ReportItem.body
plus the resolved Style — they don’t touch the raw YAML
again.
Re-exports§
pub use vocab::AGG_FNS;pub use vocab::ALL_DIRECTIVES;pub use vocab::AXIS_SCALES;pub use vocab::Directive;pub use vocab::DirectiveTarget;pub use vocab::KindMask;pub use vocab::LINE_STYLES;pub use vocab::MARKER_SHAPES;pub use vocab::PALETTE_NAMES;pub use vocab::ValueProvider;pub use vocab::YamlForm;pub use vocab::cli_flags_for;pub use vocab::directive_by_cli_flag;pub use vocab::directive_by_yaml_keyword;pub use vocab::directives_for;
Modules§
- vocab
- Single source of truth for the report grammar’s lexical vocabulary — directives, their CLI flag mapping, and the valid value space for each.
Structs§
- Parsed
Report - Result of parsing a
report:block. Warnings are non-fatal in normal mode; callers running under SRD-15 strict mode should promote them to errors. - Report
- Top-level
report:block. - Report
Group - One named container in
report:. Holds zero or more items plus group-level defaults. - Report
Item - One renderable report item — either a plot or a table.
- Series
Override - One
series <key>=<value> {...}directive. - Style
- Style and figure-metadata bag. Every field optional; cascade
is “first non-
Nonewins outer-to-inner”.
Enums§
- Destination
- SRD-46 output destination for a rendered report item.
- Kind
- Kind discriminator. Identifies which renderer owns the item.
Functions§
- parse_
persisted_ item - Parse a single persisted-form report item — header line
(
<kind> <name>) followed by indented directive lines, as produced byReportItem::to_yaml_directive_string. Used by the session-db fallback path innmbrs reportso the directive-form knowledge lives in one place. - parse_
report - Parse a
report:value (a YAML mapping) into aReport.