Skip to main content

Event

Enum Event 

Source
pub enum Event {
    Scope(ScopeEvent),
    Mark(MarkEvent),
}
Expand description

Tagged union covering the two ATOF event kinds emitted by the runtime.

Variants§

§

Scope(ScopeEvent)

Scope lifecycle event.

§

Mark(MarkEvent)

Point-in-time checkpoint event.

Implementations§

Source§

impl Event

Source

pub fn kind(&self) -> &'static str

Return the ATOF event kind.

§Returns

"scope" for Event::Scope and "mark" for Event::Mark.

Source

pub fn try_to_json_value(&self) -> Result<Value, Error>

Try to return this event as the canonical JSON object delivered by language bindings to subscriber callbacks and ATOF exporters.

Source

pub fn to_json_value(&self) -> Value

Return this event as the canonical JSON object delivered by language bindings to subscriber callbacks.

Source

pub fn to_json_string(&self) -> Result<String, Error>

Return this event as canonical JSON.

Source

pub fn scope_category(&self) -> Option<ScopeCategory>

Return the lifecycle phase for scope events.

§Returns

Some lifecycle phase for scope events, otherwise None.

Source

pub fn category(&self) -> Option<&EventCategory>

Return the semantic category if present.

§Returns

Some category for scope events and categorized mark events, otherwise None.

Source

pub fn category_profile(&self) -> Option<&CategoryProfile>

Return the category-specific profile if present.

§Returns

Some profile when category-specific fields are present.

Source

pub fn category_profile_mut(&mut self) -> Option<&mut CategoryProfile>

Return the mutable category-specific profile if present.

§Returns

Some mutable profile when category-specific fields are present.

Source

pub fn parent_uuid(&self) -> Option<Uuid>

Return the parent scope UUID, if the event is nested under a scope.

§Returns

Some parent UUID when the event has a parent scope, otherwise None.

Source

pub fn uuid(&self) -> Uuid

Return the unique event or span UUID.

§Returns

The event UUID.

Source

pub fn timestamp(&self) -> &DateTime<Utc>

Return the event timestamp.

§Returns

The UTC event timestamp.

Source

pub fn name(&self) -> &str

Return the human-readable event name.

§Returns

The event name.

Source

pub fn data(&self) -> Option<&Value>

Return the optional application payload attached to the event.

§Returns

Some payload when event data is present, otherwise None.

Source

pub fn sanitize_fields(&self) -> EventSanitizeFields

Snapshot the observability fields that sanitizers may rewrite.

Source

pub fn apply_sanitize_fields(&mut self, fields: EventSanitizeFields)

Replace the observability fields controlled by event sanitizers.

Source

pub fn data_schema(&self) -> Option<&DataSchema>

Return the optional data schema.

§Returns

Some schema when the event payload declares one, otherwise None.

Source

pub fn metadata(&self) -> Option<&Value>

Return the optional metadata attached to the event.

§Returns

Some metadata when present, otherwise None.

Source

pub fn attributes(&self) -> Option<&[String]>

Return attributes for scope events.

§Returns

Some attributes for scope events, otherwise None.

Source

pub fn scope_type(&self) -> Option<ScopeType>

Return the semantic scope category for scope events.

§Returns

Some legacy ScopeType when the event has a category.

Source

pub fn input(&self) -> Option<&Value>

Return the semantic input payload for start events.

§Returns

Some payload for scope-start events with data, otherwise None.

Source

pub fn output(&self) -> Option<&Value>

Return the semantic output payload for end events.

§Returns

Some payload for scope-end events with data, otherwise None.

Source

pub fn model_name(&self) -> Option<&str>

Return the normalized model name for LLM events.

§Returns

Some model name when the event profile includes one.

Source

pub fn tool_call_id(&self) -> Option<&str>

Return the provider-specific tool-call correlation identifier.

§Returns

Some tool call identifier when the event profile includes one.

Source

pub fn annotated_request(&self) -> Option<&Arc<AnnotatedLlmRequest>>

Return the runtime-only annotated LLM request.

§Returns

Some annotated request when the event profile includes one.

Source

pub fn annotated_response(&self) -> Option<&Arc<AnnotatedLlmResponse>>

Return the runtime-only annotated LLM response.

§Returns

Some annotated response when the event profile includes one.

Source

pub fn is_scope_start(&self) -> bool

Return true for scope-start events.

§Returns

true when the event is a scope-start event.

Source

pub fn is_scope_end(&self) -> bool

Return true for scope-end events.

§Returns

true when the event is a scope-end event.

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Event

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Event

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Event, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl EventNormalizationExt for Event

Source§

fn normalized_llm_request(&self) -> Option<Cow<'_, AnnotatedLlmRequest>>

Normalized LLM request: the codec annotation when present, otherwise a best-effort decode of the start-event input payload. Read more
Source§

fn normalized_llm_response(&self) -> Option<Cow<'_, AnnotatedLlmResponse>>

Normalized LLM response: the codec annotation when present, otherwise a best-effort decode of the end-event output payload.
Source§

impl PartialEq for Event

Source§

fn eq(&self, other: &Event) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Event

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Event

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnsafeUnpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more