Struct Presentation
pub struct Presentation {
pub elements: Vec<ElementSpec>,
pub theme: Option<Theme>,
pub messages: BTreeMap<String, LocalizedText>,
}Expand description
How a profile presents itself on the dashboard: its custom elements and theme.
A Profile carries an optional presentation, so a deployment’s
dashboard offers exactly the sensor types its profiles introduce and renders them
the way the profile intends. The dashboard turns these declarations into the catalog
it serves to the page.
Fields§
§elements: Vec<ElementSpec>The custom sensors and node stats this profile contributes.
theme: Option<Theme>An optional theme that tints the dashboard.
messages: BTreeMap<String, LocalizedText>Localized text for the stable codes this profile introduces, keyed by the page’s
message key (a discrete state such as "state.flushing" or an event such as
"event.filter_clog"). The dashboard ships no translation for a code it never knew,
so a profile that emits a custom state or event supplies its wording here.
Implementations§
§impl Presentation
impl Presentation
pub fn new() -> Presentation
pub fn new() -> Presentation
pub fn with_element(self, element: ElementSpec) -> Presentation
pub fn with_element(self, element: ElementSpec) -> Presentation
pub fn with_theme(self, theme: Theme) -> Presentation
pub fn with_theme(self, theme: Theme) -> Presentation
pub fn with_message(
self,
key: impl Into<String>,
text: impl Into<LocalizedText>,
) -> Presentation
pub fn with_message( self, key: impl Into<String>, text: impl Into<LocalizedText>, ) -> Presentation
Supplies localized text for a stable code this profile introduces.
Use this for a custom discrete state or event the dashboard ships no wording for, so the page renders it as words rather than the raw code.
§Arguments
key- the page message key, such as"state.flushing"or"event.filter_clog".text- the text, one string for every locale or a per-locale map.
§Returns
The presentation, for chaining.
Trait Implementations§
§impl Clone for Presentation
impl Clone for Presentation
§fn clone(&self) -> Presentation
fn clone(&self) -> Presentation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more