pub struct ProductGauge { /* private fields */ }Expand description
Typed handle for a registered product gauge.
Implementations§
Source§impl ProductGauge
impl ProductGauge
Sourcepub fn from_handle(handle: ProductMetricHandle) -> ProductMetricResult<Self>
pub fn from_handle(handle: ProductMetricHandle) -> ProductMetricResult<Self>
Creates a typed gauge from an opaque product metric handle.
§Errors
Returns an error when the handle is not a gauge or its descriptor is unavailable.
Sourcepub const fn handle(&self) -> ProductMetricHandle
pub const fn handle(&self) -> ProductMetricHandle
Returns the underlying opaque handle.
Sourcepub fn set(&self, label_values: &[&str], value: f64)
pub fn set(&self, label_values: &[&str], value: f64)
Sets this gauge and logs recording failures.
Sourcepub fn try_set(
&self,
label_values: &[&str],
value: f64,
) -> ProductMetricResult<()>
pub fn try_set( &self, label_values: &[&str], value: f64, ) -> ProductMetricResult<()>
Sets this gauge and returns recording failures.
§Errors
Returns an error when the label count is wrong or the gauge cannot be set.
Trait Implementations§
Source§impl Clone for ProductGauge
impl Clone for ProductGauge
Source§fn clone(&self) -> ProductGauge
fn clone(&self) -> ProductGauge
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProductGauge
impl Debug for ProductGauge
Source§impl PartialEq for ProductGauge
impl PartialEq for ProductGauge
impl Copy for ProductGauge
impl Eq for ProductGauge
impl StructuralPartialEq for ProductGauge
Auto Trait Implementations§
impl Freeze for ProductGauge
impl RefUnwindSafe for ProductGauge
impl Send for ProductGauge
impl Sync for ProductGauge
impl Unpin for ProductGauge
impl UnwindSafe for ProductGauge
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.