Struct prometheus::core::GenericCounter
source · pub struct GenericCounter<P: Atomic> { /* private fields */ }
Expand description
The underlying implementation for Counter
and IntCounter
.
Implementations§
source§impl<P: Atomic> GenericCounter<P>
impl<P: Atomic> GenericCounter<P>
sourcepub fn new<S1: Into<String>, S2: Into<String>>(
name: S1,
help: S2,
) -> Result<Self>
pub fn new<S1: Into<String>, S2: Into<String>>( name: S1, help: S2, ) -> Result<Self>
Create a GenericCounter
with the name
and help
arguments.
sourcepub fn with_opts(opts: Opts) -> Result<Self>
pub fn with_opts(opts: Opts) -> Result<Self>
Create a GenericCounter
with the opts
options.
sourcepub fn local(&self) -> GenericLocalCounter<P>
pub fn local(&self) -> GenericLocalCounter<P>
Return a GenericLocalCounter
for single thread usage.
Trait Implementations§
source§impl<P: Atomic> Clone for GenericCounter<P>
impl<P: Atomic> Clone for GenericCounter<P>
source§impl<P: Atomic> Collector for GenericCounter<P>
impl<P: Atomic> Collector for GenericCounter<P>
Auto Trait Implementations§
impl<P> Freeze for GenericCounter<P>
impl<P> RefUnwindSafe for GenericCounter<P>where
P: RefUnwindSafe,
impl<P> Send for GenericCounter<P>
impl<P> Sync for GenericCounter<P>
impl<P> Unpin for GenericCounter<P>
impl<P> UnwindSafe for GenericCounter<P>where
P: RefUnwindSafe,
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)