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<T: Into<Cow<'static, str>>>(
name: String,
instrumentation_name: T,
instrumentation_version: Option<T>,
instrument_kind: InstrumentKind,
number_kind: NumberKind,
) -> Self
pub fn new<T: Into<Cow<'static, str>>>( name: String, instrumentation_name: T, instrumentation_version: Option<T>, instrument_kind: InstrumentKind, number_kind: NumberKind, ) -> Self
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 instrumentation_name(&self) -> Cow<'static, str>
pub fn instrumentation_name(&self) -> Cow<'static, str>
The name of the library that provided instrumentation for this instrument.
Sourcepub fn instrumentation_version(&self) -> Option<Cow<'static, str>>
pub fn instrumentation_version(&self) -> Option<Cow<'static, str>>
The version of library that provided instrumentation for this instrument. Optional
Sourcepub fn instrumentation_library(&self) -> &InstrumentationLibrary
pub fn instrumentation_library(&self) -> &InstrumentationLibrary
Instrumentation library reference
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 duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const 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 for Descriptor
impl PartialEq for Descriptor
impl StructuralPartialEq for Descriptor
Auto Trait Implementations§
impl Freeze for Descriptor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Available on crate feature
trace
only.Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Available on crate feature
trace
only.