Struct dipstick::LineTemplate
source · pub struct LineTemplate { /* private fields */ }
Expand description
An sequence of print commands, embodying an output strategy for a single metric.
Implementations§
source§impl LineTemplate
impl LineTemplate
sourcepub fn new(ops: Vec<LineOp>) -> Self
pub fn new(ops: Vec<LineOp>) -> Self
Make a new LineTemplate
Examples found in repository?
examples/text_format_label.rs (lines 15-28)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
fn template(&self, name: &MetricName, _kind: InputKind) -> LineTemplate {
LineTemplate::new(vec![
LineOp::Literal(format!("{} ", name.join(".")).to_uppercase().into()),
LineOp::ValueAsText,
LineOp::Literal(" ".into()),
LineOp::LabelExists(
"abc".into(),
vec![
LabelOp::LabelKey,
LabelOp::Literal(":".into()),
LabelOp::LabelValue,
],
),
LineOp::NewLine,
])
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LineTemplate
impl RefUnwindSafe for LineTemplate
impl Send for LineTemplate
impl Sync for LineTemplate
impl Unpin for LineTemplate
impl UnwindSafe for LineTemplate
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