Struct opentelemetry::sdk::metrics::sdk_api::Descriptor
source · pub struct Descriptor { /* private fields */ }
Available on crate feature
metrics
only.Expand description
Descriptor contains all the settings that describe an instrument, including its name, metric kind, number kind, and the configurable options.
Implementations§
source§impl Descriptor
impl Descriptor
sourcepub fn new(
name: String,
instrument_kind: InstrumentKind,
number_kind: NumberKind,
description: Option<String>,
unit: Option<Unit>
) -> Descriptor
pub fn new( name: String, instrument_kind: InstrumentKind, number_kind: NumberKind, description: Option<String>, unit: Option<Unit> ) -> Descriptor
Create a new descriptor
sourcepub fn instrument_kind(&self) -> &InstrumentKind
pub fn instrument_kind(&self) -> &InstrumentKind
The specific kind of instrument.
sourcepub fn number_kind(&self) -> &NumberKind
pub fn number_kind(&self) -> &NumberKind
NumberKind returns whether this instrument is declared over int64, float64, or uint64 values.
sourcepub fn description(&self) -> Option<&String>
pub fn description(&self) -> Option<&String>
A human-readable description of the metric instrument.
sourcepub fn set_description(&mut self, description: String)
pub fn set_description(&mut self, description: String)
Assign a new description
sourcepub fn attribute_hash(&self) -> u64
pub fn attribute_hash(&self) -> u64
The pre-computed hash of the descriptor data
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 moresource§impl Debug for Descriptor
impl Debug for Descriptor
source§impl PartialEq<Descriptor> for Descriptor
impl PartialEq<Descriptor> for Descriptor
source§fn eq(&self, other: &Descriptor) -> bool
fn eq(&self, other: &Descriptor) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for Descriptor
impl StructuralEq for Descriptor
impl StructuralPartialEq for Descriptor
Auto 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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.