Struct prometheus::core::GenericGauge [−][src]
Implementations
impl<P: Atomic> GenericGauge<P>
[src]
pub fn new<S1: Into<String>, S2: Into<String>>(
name: S1,
help: S2
) -> Result<Self>
[src]
name: S1,
help: S2
) -> Result<Self>
Create a GenericGauge
with the name
and help
arguments.
pub fn with_opts(opts: Opts) -> Result<Self>
[src]
Create a GenericGauge
with the opts
options.
pub fn set(&self, v: P::T)
[src]
Set the gauge to an arbitrary value.
pub fn inc(&self)
[src]
Increase the gauge by 1.
pub fn dec(&self)
[src]
Decrease the gauge by 1.
pub fn add(&self, v: P::T)
[src]
Add the given value to the gauge. (The value can be negative, resulting in a decrement of the gauge.)
pub fn sub(&self, v: P::T)
[src]
Subtract the given value from the gauge. (The value can be negative, resulting in an increment of the gauge.)
pub fn get(&self) -> P::T
[src]
Return the gauge value.
Trait Implementations
impl<P: Atomic> Clone for GenericGauge<P>
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<P: Atomic> Collector for GenericGauge<P>
[src]
impl<P: Debug + Atomic> Debug for GenericGauge<P>
[src]
impl<P: Atomic> Metric for GenericGauge<P>
[src]
Auto Trait Implementations
impl<P> RefUnwindSafe for GenericGauge<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
impl<P> Send for GenericGauge<P>
impl<P> Sync for GenericGauge<P>
impl<P> Unpin for GenericGauge<P>
impl<P> UnwindSafe for GenericGauge<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,