Struct prometheus_client::registry::Descriptor
source · pub struct Descriptor { /* private fields */ }
Expand description
OpenMetrics metric descriptor.
Implementations§
source§impl Descriptor
impl Descriptor
sourcepub fn new<N: Into<String>, H: Into<String>>(
name: N,
help: H,
unit: Option<Unit>,
prefix: Option<&Prefix>,
labels: Vec<(Cow<'static, str>, Cow<'static, str>)>
) -> Self
pub fn new<N: Into<String>, H: Into<String>>( name: N, help: H, unit: Option<Unit>, prefix: Option<&Prefix>, labels: Vec<(Cow<'static, str>, Cow<'static, str>)> ) -> Self
Create new Descriptor
.
sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the name of the OpenMetrics metric Descriptor
.
sourcepub fn help(&self) -> &str
pub fn help(&self) -> &str
Returns the help text of the OpenMetrics metric Descriptor
.
sourcepub fn unit(&self) -> &Option<Unit>
pub fn unit(&self) -> &Option<Unit>
Returns the unit of the OpenMetrics metric Descriptor
.
Trait Implementations§
source§impl Clone for Descriptor
impl Clone for Descriptor
source§fn clone(&self) -> Descriptor
fn clone(&self) -> Descriptor
Returns a copy 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 moreAuto Trait Implementations§
impl RefUnwindSafe for Descriptor
impl Send for Descriptor
impl Sync for Descriptor
impl Unpin for Descriptor
impl UnwindSafe for Descriptor
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