pub struct Manifest {
pub chartlet: &'static str,
pub schema_version: u8,
pub spec_hash: String,
pub output_hash: String,
pub format: RenderFormat,
pub variant: Variant,
pub id_prefix: String,
pub view: Option<String>,
pub views: Vec<String>,
pub perspective: Option<String>,
pub theme: Option<String>,
pub warnings: Vec<ChartWarning>,
}Expand description
The provenance of one render: which version of chartlet produced which output from which specification, with which options and warnings. It carries no timestamp, so the same render always yields the same manifest.
Fields§
§chartlet: &'static strThe version of the chartlet crate that rendered.
schema_version: u8§spec_hash: Stringsha256: and the hexadecimal SHA-256 of the canonical specification: the parsed
specification serialized again, so key order and whitespace of the input do not matter.
output_hash: Stringsha256: and the hexadecimal SHA-256 of RenderOutput::content as UTF-8.
format: RenderFormat§variant: Variant§id_prefix: StringThe ID prefix the chart was rendered with: the one passed in, or the one derived from the
specification. The mobile variant appends -m to it, the print variant -p, the social
variant -s.
view: Option<String>The key of the view of an architecture model that was rendered; None for a
specification without views. spec_hash is the hash of the whole model.
views: Vec<String>The keys of the views of an architecture model shown on one page with
RenderOptions::all_views, in the order of the page; empty otherwise.
perspective: Option<String>The key of the perspective of an architecture diagram that was shown; None without
one.
theme: Option<String>The theme a host applied to the specification before rendering: the name of a bundled
theme or the path of a theme file. The compiler renders the themed specification and
does not know it; the CLI sets it. None without one.
warnings: Vec<ChartWarning>Implementations§
Source§impl Manifest
impl Manifest
Sourcepub fn to_json(&self) -> String
pub fn to_json(&self) -> String
The manifest as a pretty-printed JSON object, its keys in a fixed order:
chartlet, schemaVersion, specHash, outputHash, format, variant, idPrefix,
view (only when a view was rendered), views (only when all views were rendered on one
page), perspective (only when one was shown), theme (only when a host applied one),
warnings (each with code, path, message).
§Panics
Never: every field is a string, a number or a list of strings.