Skip to main content

Style

Struct Style 

Source
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

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for Style

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Style

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Style

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Style

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Style

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Style

§

impl RefUnwindSafe for Style

§

impl Send for Style

§

impl Sync for Style

§

impl Unpin for Style

§

impl UnsafeUnpin for Style

§

impl UnwindSafe for Style

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.