Enum Event

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.

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

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

Variants

Scope(ScopeEvent)

Scope(ScopeEvent)

Scope lifecycle event.

Mark(MarkEvent)

Mark(MarkEvent)

Point-in-time checkpoint event.

Implementations

impl Event

impl Event

kind

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

Return the ATOF event kind.

Returns

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

try_to_json_value

pub fn try_to_json_value(&self) -> Result<Json>

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

to_json_value

pub fn to_json_value(&self) -> Json

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

to_json_string

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

Return this event as canonical JSON.

scope_category

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

Return the lifecycle phase for scope events.

Returns

Some lifecycle phase for scope events, otherwise None.

category

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

Return the semantic category if present.

Returns

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

category_profile

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

Return the category-specific profile if present.

Returns

Some profile when category-specific fields are present.

category_profile_mut

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.

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

uuid

pub fn uuid(&self) -> Uuid

Return the unique event or span UUID.

Returns

The event UUID.

timestamp

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

Return the event timestamp.

Returns

The UTC event timestamp.

name

pub fn name(&self) -> &str

Return the human-readable event name.

Returns

The event name.

data

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

Return the optional application payload attached to the event.

Returns

Some payload when event data is present, otherwise None.

data_schema

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

Return the optional data schema.

Returns

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

metadata

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

Return the optional metadata attached to the event.

Returns

Some metadata when present, otherwise None.

attributes

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

Return attributes for scope events.

Returns

Some attributes for scope events, otherwise None.

scope_type

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.

input

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

Return the semantic input payload for start events.

Returns

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

output

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

Return the semantic output payload for end events.

Returns

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

model_name

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.

tool_call_id

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.

annotated_request

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.

annotated_response

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.

is_scope_start

pub fn is_scope_start(&self) -> bool

Return true for scope-start events.

Returns

true when the event is a scope-start event.

is_scope_end

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

impl Clone for Event

impl Clone for Event

clone

fn clone(&self) -> Event

clone_from

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

impl Debug for Event

impl Debug for Event

fmt

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

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

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

deserialize

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

impl PartialEq for Event

impl PartialEq for Event

eq

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

ne

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

impl Serialize for Event

impl Serialize for Event

serialize

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

impl StructuralPartialEq for Event

impl StructuralPartialEq for Event