pub struct ChartParams {
pub chart_kind: Option<String>,
pub chart_series: Option<String>,
pub renderer: Option<String>,
}Expand description
Chart-specific query parameters shared across report chart handlers.
chart_kind maps to plotting::ChartKind; chart_series is a
report-specific toggle (e.g. Activity: show Net or not) parsed in
each handler. renderer picks between server-side SVG (default)
and client-side canvas.
Fields§
§chart_kind: Option<String>§chart_series: Option<String>§renderer: Option<String>Implementations§
Source§impl ChartParams
impl ChartParams
Sourcepub fn chart_kind_or_default(&self) -> ChartKind
pub fn chart_kind_or_default(&self) -> ChartKind
Parse chart_kind (bar, line, stacked) into a
plotting::ChartKind. Unknown / missing values fall back to
Bar so a stale URL still renders something.
Sourcepub fn chart_kind_str(&self) -> String
pub fn chart_kind_str(&self) -> String
Normalise the chart kind to its canonical lowercase name so
the template can round-trip it into URLs and <select>
values.
Sourcepub fn renderer_str(&self) -> String
pub fn renderer_str(&self) -> String
Canonicalise the renderer choice. Accepts svg (default) and
canvas; anything else normalises to svg.
Trait Implementations§
Source§impl Default for ChartParams
impl Default for ChartParams
Source§fn default() -> ChartParams
fn default() -> ChartParams
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ChartParams
impl<'de> Deserialize<'de> for ChartParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ChartParams
impl RefUnwindSafe for ChartParams
impl Send for ChartParams
impl Sync for ChartParams
impl Unpin for ChartParams
impl UnsafeUnpin for ChartParams
impl UnwindSafe for ChartParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more