Skip to main content

GatewayEvent

Defined in the gateway module.
Rust AI Agent SDK A gateway event with metadata.

Fields

NameTypeDescription
event_typeEventTypeThe event type
dataserde_json::ValueEvent payload
event_idStringUnique event identifier
timestampf64Event creation time (Unix timestamp)
sourceOption<String>Source identifier (agent_id, client_id, etc.)
targetOption<String>Target identifier (optional, for directed events)

Methods

new

fn new(event_type: EventType) -> Self
Create a new gateway event. Parameters:
NameType
event_typeEventType

data

fn data(mut self, data: serde_json::Value) -> Self
Set event data. Parameters:
NameType
dataserde_json::Value

source

fn source(mut self, source: impl Into<String>) -> Self
Set source identifier. Parameters:
NameType
sourceimpl Into&lt;String&gt;

target

fn target(mut self, target: impl Into<String>) -> Self
Set target identifier. Parameters:
NameType
targetimpl Into&lt;String&gt;

Source

View on GitHub

praisonai/src/gateway/mod.rs at line 97