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
sourceimpl 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
sourceimpl Clone for Descriptor
impl Clone for Descriptor
sourcefn clone(&self) -> Descriptor
fn clone(&self) -> Descriptor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Descriptor
impl Debug for Descriptor
sourceimpl PartialEq<Descriptor> for Descriptor
impl PartialEq<Descriptor> for Descriptor
sourcefn 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 ==
. Read more
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<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,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.