#[non_exhaustive]pub enum Kind {
Span,
Metric,
}Expand description
A kind of specialized diagnostic event.
If a crate::Event has a kind associated with it, it can be pulled from its props:
match evt.props().pull::<emit::Kind, _>(emit::well_known::KEY_EVT_KIND) {
Some(emit::Kind::Span) => {
// The event is a span
}
Some(emit::Kind::Metric) => {
// The event is a metric
}
Some(_) => {
// The event is an unknown kind
}
None => {
// The event doesn't have a specific kind
}
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Span
The event is a span in a distributed trace.
This variant is equal to EVENT_KIND_SPAN. See the crate::span module for details.
Metric
The event is a metric sample.
This variant is equal to EVENT_KIND_METRIC. See the crate::metric module for details.
Implementations§
Source§impl Kind
impl Kind
Sourcepub fn try_from_str(s: &str) -> Result<Self, ParseKindError>
pub fn try_from_str(s: &str) -> Result<Self, ParseKindError>
Try parse a kind from a formatted representation.
Trait Implementations§
Source§impl<'v> FromValue<'v> for Kind
impl<'v> FromValue<'v> for Kind
Source§fn from_value(value: Value<'v>) -> Option<Self>
fn from_value(value: Value<'v>) -> Option<Self>
Perform the conversion.
impl Copy for Kind
impl Eq for Kind
impl StructuralPartialEq for Kind
Auto Trait Implementations§
impl Freeze for Kind
impl RefUnwindSafe for Kind
impl Send for Kind
impl Sync for Kind
impl Unpin for Kind
impl UnwindSafe for Kind
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