pub struct Report {
pub defaults: Style,
pub groups: Vec<ReportGroup>,
}Expand description
Top-level report: block.
Fields§
§defaults: StyleCross-cutting style + metadata defaults declared via the
reserved defaults: mapping. Cascade into every group.
groups: Vec<ReportGroup>Groups in YAML declaration order. Each group’s name becomes a markdown section heading; items render in body order.
Implementations§
Source§impl Report
impl Report
Sourcepub fn items(&self) -> impl Iterator<Item = &ReportItem>
pub fn items(&self) -> impl Iterator<Item = &ReportItem>
Iterate every item across every group in declaration order.
Sourcepub fn find(&self, name: &str) -> Option<&ReportItem>
pub fn find(&self, name: &str) -> Option<&ReportItem>
Find an item by canonical name. Returns the first match in
declaration order. Names should be unique within a Report
(collisions are caught at parse time).
Sourcepub fn merge_child(&mut self, child: Report) -> Result<Vec<String>, String>
pub fn merge_child(&mut self, child: Report) -> Result<Vec<String>, String>
Merge a child’s report into this one, by group name (SRD-72,
SRD-108): a group this report lacks is appended, a group of the
same name replaces this report’s whole, a group declared none
removes it, and defaults merge per directive with the child’s
winning.
Returns warnings: a none group that names nothing to remove.
An item name that ends up declared twice is an error, as it is
within one document.
Sourcepub fn drop_removed(&mut self) -> Vec<String>
pub fn drop_removed(&mut self) -> Vec<String>
Drop every group declared none, returning a warning for each:
in a document with nothing to inherit from, such a group removes
nothing.
Sourcepub fn effective_style(&self, group: &ReportGroup, item: &ReportItem) -> Style
pub fn effective_style(&self, group: &ReportGroup, item: &ReportItem) -> Style
Resolve the effective style for one item, walking the cascade: report defaults → group defaults → item directives.