Struct Event
struct Event<'a> { ... }
Events represent single points in time where something occurred during the
execution of a program.
An Event can be compared to a log record in unstructured logging, but with
two key differences:
Events exist within the context of a span. Unlike log lines, they may be located within the trace tree, allowing visibility into the temporal context in which the event occurred, as well as the source code location.- Like spans,
Events have structured key-value data known as fields, which may include textual message. In general, a majority of the data associated with an event should be in the event's fields rather than in the textual message, as the fields are more structured.
Implementations
impl<'a> Event<'a>
fn dispatch(metadata: &'static Metadata<'static>, fields: &'a ValueSet<'_>)Constructs a new
Eventwith the specified metadata and set of values, and observes it with the current subscriber.fn new(metadata: &'static Metadata<'static>, fields: &'a ValueSet<'a>) -> SelfReturns a new
Eventin the current span, with the specified metadata and set of values.fn new_child_of<impl Into<Option<Id>>: Into<Option<Id>>>(parent: impl Into<Option<Id>>, metadata: &'static Metadata<'static>, fields: &'a ValueSet<'a>) -> SelfReturns a new
Eventas a child of the specified span, with the provided metadata and set of values.fn child_of<impl Into<Option<Id>>: Into<Option<Id>>>(parent: impl Into<Option<Id>>, metadata: &'static Metadata<'static>, fields: &'a ValueSet<'_>)Constructs a new
Eventwith the specified metadata and set of values, and observes it with the current subscriber and an explicit parent.fn record(self: &Self, visitor: &mut dyn Visit)Visits all the fields on this
Eventwith the specified visitor.fn fields(self: &Self) -> IterReturns an iterator over the set of values on this
Event.fn metadata(self: &Self) -> &'static Metadata<'static>Returns metadata describing this
Event.fn is_root(self: &Self) -> boolReturns true if the new event should be a root.
fn is_contextual(self: &Self) -> boolReturns true if the new event's parent should be determined based on the current context.
If this is true and the current thread is currently inside a span, then that span should be the new event's parent. Otherwise, if the current thread is not inside a span, then the new event will be the root of its own trace tree.
fn parent(self: &Self) -> Option<&Id>Returns the new event's explicitly-specified parent, if there is one.
Otherwise (if the new event is a root or is a child of the current span), returns
None.
impl<'a> Debug for Event<'a>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<'a> Freeze for Event<'a>
impl<'a> RefUnwindSafe for Event<'a>
impl<'a> Send for Event<'a>
impl<'a> Sync for Event<'a>
impl<'a> Unpin for Event<'a>
impl<'a> UnsafeUnpin for Event<'a>
impl<'a> UnwindSafe for Event<'a>
impl<T> Any for Event<'a>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Event<'a>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Event<'a>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for Event<'a>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for Event<'a>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Event<'a>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Event<'a>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>