pub struct Style {
pub palette: Option<String>,
pub line: Option<String>,
pub width: Option<f32>,
pub marker: Option<String>,
pub size: Option<f32>,
pub color: Option<String>,
pub figure_width: Option<u32>,
pub figure_height: Option<u32>,
pub series: Vec<SeriesOverride>,
pub destinations: Option<Vec<Destination>>,
}Expand description
Style and figure-metadata bag. Every field optional; cascade
is “first non-None wins outer-to-inner”.
Fields§
§palette: Option<String>Palette name or numeric index ("wong", "3").
line: Option<String>Line-dash style: solid, dashed, dotted, dashdot,
none.
width: Option<f32>Stroke width in pixels.
marker: Option<String>Marker shape: none, circle, square, triangle,
diamond, plus, cross.
size: Option<f32>Marker radius in pixels.
color: Option<String>Hex color override (#RRGGBB).
figure_width: Option<u32>Figure width in pixels.
figure_height: Option<u32>Figure height in pixels.
series: Vec<SeriesOverride>Per-series JSON sub-block overrides keyed by the
<key>=<value> discriminator after the series directive.
Values are arbitrary JSON objects; renderers consume the
fields they recognise.
destinations: Option<Vec<Destination>>SRD-46 output routing (to stdout, sessiondir). None
means “not declared at this level” — the cascade keeps
looking outward, and the render entry point supplies the
default when nothing declared it anywhere.
Implementations§
Source§impl Style
impl Style
Sourcepub fn scalar_directive_lines(&self) -> Vec<String>
pub fn scalar_directive_lines(&self) -> Vec<String>
Render the scalar (non-series) fields of this style
as a list of key=value directive lines, in the
canonical vocab::ALL_DIRECTIVES order. Used by
ReportItem::to_yaml_directive_string and by
the series sub-block renderer.
None fields are skipped; only fields whose vocab
target is vocab::DirectiveTarget::StyleField
are emitted.
Sourcepub fn merge_from(&mut self, other: &Style)
pub fn merge_from(&mut self, other: &Style)
Merge other into self: every Some(_) field in other
overrides the corresponding field in self. Used to walk
the cascade outer → inner.
Sourcepub fn destinations_or(&self, default_to: &[Destination]) -> Vec<Destination>
pub fn destinations_or(&self, default_to: &[Destination]) -> Vec<Destination>
The declared destination set, or default_to when no
level of the cascade declared one. Callers pass the
default their entry point implies — files-only for
automatic end-of-run rendering, files+stdout for an
explicit nmbrs report invocation.