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 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 PartialEq for Event

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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.