pub enum Event {
Scope(ScopeEvent),
Mark(MarkEvent),
}Expand description
Tagged union covering the two ATOF event kinds emitted by the runtime.
Variants§
Implementations§
Source§impl Event
impl Event
Sourcepub fn try_to_json_value(&self) -> Result<Value, Error>
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.
Sourcepub fn to_json_value(&self) -> Value
pub fn to_json_value(&self) -> Value
Return this event as the canonical JSON object delivered by language bindings to subscriber callbacks.
Sourcepub fn to_json_string(&self) -> Result<String, Error>
pub fn to_json_string(&self) -> Result<String, Error>
Return this event as canonical JSON.
Sourcepub fn scope_category(&self) -> Option<ScopeCategory>
pub fn scope_category(&self) -> Option<ScopeCategory>
Return the lifecycle phase for scope events.
§Returns
Some lifecycle phase for scope events, otherwise None.
Sourcepub fn category(&self) -> Option<&EventCategory>
pub fn category(&self) -> Option<&EventCategory>
Return the semantic category if present.
§Returns
Some category for scope events and categorized mark events, otherwise
None.
Sourcepub fn category_profile(&self) -> Option<&CategoryProfile>
pub fn category_profile(&self) -> Option<&CategoryProfile>
Return the category-specific profile if present.
§Returns
Some profile when category-specific fields are present.
Sourcepub fn category_profile_mut(&mut self) -> Option<&mut CategoryProfile>
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.
Sourcepub fn parent_uuid(&self) -> Option<Uuid>
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.
Sourcepub fn data(&self) -> Option<&Value>
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.
Sourcepub fn sanitize_fields(&self) -> EventSanitizeFields
pub fn sanitize_fields(&self) -> EventSanitizeFields
Snapshot the observability fields that sanitizers may rewrite.
Sourcepub fn apply_sanitize_fields(&mut self, fields: EventSanitizeFields)
pub fn apply_sanitize_fields(&mut self, fields: EventSanitizeFields)
Replace the observability fields controlled by event sanitizers.
Sourcepub fn data_schema(&self) -> Option<&DataSchema>
pub fn data_schema(&self) -> Option<&DataSchema>
Return the optional data schema.
§Returns
Some schema when the event payload declares one, otherwise None.
Sourcepub fn metadata(&self) -> Option<&Value>
pub fn metadata(&self) -> Option<&Value>
Return the optional metadata attached to the event.
§Returns
Some metadata when present, otherwise None.
Sourcepub fn attributes(&self) -> Option<&[String]>
pub fn attributes(&self) -> Option<&[String]>
Sourcepub fn scope_type(&self) -> Option<ScopeType>
pub fn scope_type(&self) -> Option<ScopeType>
Sourcepub fn input(&self) -> Option<&Value>
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.
Sourcepub fn output(&self) -> Option<&Value>
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.
Sourcepub fn model_name(&self) -> Option<&str>
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.
Sourcepub fn tool_call_id(&self) -> Option<&str>
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.
Sourcepub fn annotated_request(&self) -> Option<&Arc<AnnotatedLlmRequest>>
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.
Sourcepub fn annotated_response(&self) -> Option<&Arc<AnnotatedLlmResponse>>
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.
Sourcepub fn is_scope_start(&self) -> bool
pub fn is_scope_start(&self) -> bool
Sourcepub fn is_scope_end(&self) -> bool
pub fn is_scope_end(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Event, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Event, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl EventNormalizationExt for Event
impl EventNormalizationExt for Event
Source§fn normalized_llm_request(&self) -> Option<Cow<'_, AnnotatedLlmRequest>>
fn normalized_llm_request(&self) -> Option<Cow<'_, AnnotatedLlmRequest>>
Source§fn normalized_llm_response(&self) -> Option<Cow<'_, AnnotatedLlmResponse>>
fn normalized_llm_response(&self) -> Option<Cow<'_, AnnotatedLlmResponse>>
Source§impl Serialize for Event
impl Serialize for Event
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request