Skip to main content

SpanEvent

Defined in the trace module.
Rust AI Agent SDK An event within a span.

Fields

NameTypeDescription
nameStringEvent name
timestampDurationTimestamp (as duration since trace start)
attributesHashMap<StringAttributes
serde_json:Value>Attributes

Methods

new

fn new(name: impl Into<String>, timestamp: Duration) -> Self
Create a new event. Parameters:
NameType
nameimpl Into&lt;String&gt;
timestampDuration

with_attribute

fn with_attribute(mut self, key: impl Into<String>, value: impl Serialize) -> Self
Add an attribute. Parameters:
NameType
keyimpl Into&lt;String&gt;
valueimpl Serialize

Source

View on GitHub

praisonai/src/trace/mod.rs at line 175