pub struct Opts<'a> { /* private fields */ }
Expand description
A more generic prometheus options that allow construction of both scalar and vector metrics.
Implementations§
Source§impl<'a> Opts<'a>
impl<'a> Opts<'a>
Sourcepub fn new(name: &'a str, desc: &'a str) -> Self
pub fn new(name: &'a str, desc: &'a str) -> Self
Create a new generic metric option based name, helper text and optional labels.
Sourcepub fn with_labels(self, labels: &'a [&'a str]) -> Self
pub fn with_labels(self, labels: &'a [&'a str]) -> Self
Attaches labels to the options.
Sourcepub fn with_buckets(self, buckets: &'a [f64]) -> Self
pub fn with_buckets(self, buckets: &'a [f64]) -> Self
Attaches buckets to the options.
Trait Implementations§
Source§impl TryFrom<Opts<'_>> for CounterVec
impl TryFrom<Opts<'_>> for CounterVec
Source§impl TryFrom<Opts<'_>> for IntCounterVec
impl TryFrom<Opts<'_>> for IntCounterVec
Source§impl TryFrom<Opts<'_>> for IntGaugeVec
impl TryFrom<Opts<'_>> for IntGaugeVec
Auto Trait Implementations§
impl<'a> Freeze for Opts<'a>
impl<'a> RefUnwindSafe for Opts<'a>
impl<'a> Send for Opts<'a>
impl<'a> Sync for Opts<'a>
impl<'a> Unpin for Opts<'a>
impl<'a> UnwindSafe for Opts<'a>
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