pub struct TelemetryEvent {
pub session_id: Option<String>,
pub node_id: String,
pub packet: CustomPacketData,
}Expand description
A telemetry event emitted by a node.
This wraps CustomPacketData to maintain wire-compatibility with the packet system,
enabling future “telemetry as track” patterns where events flow through the graph.
§Field Locations
session_id,node_id: Envelope fields (not duplicated in packet data)event_type,correlation_id,turn_id: Insidepacket.datatimestamp_us: Insidepacket.metadata
Fields§
§session_id: Option<String>Session this event belongs to (for future shared bus / cross-session sinks)
node_id: StringThe node that emitted this event (canonical source, not in packet data)
packet: CustomPacketDataThe telemetry payload wrapped as a Custom packet for wire compatibility
Implementations§
Source§impl TelemetryEvent
impl TelemetryEvent
Sourcepub fn new(
session_id: Option<String>,
node_id: String,
event_data: JsonValue,
timestamp_us: u64,
) -> Self
pub fn new( session_id: Option<String>, node_id: String, event_data: JsonValue, timestamp_us: u64, ) -> Self
Create a new telemetry event.
The event_data should contain at minimum event_type. Additional fields
like correlation_id, turn_id, and event-specific data can be included.
Sourcepub fn event_type(&self) -> Option<&str>
pub fn event_type(&self) -> Option<&str>
Extract the event_type from the packet data.
Sourcepub fn correlation_id(&self) -> Option<&str>
pub fn correlation_id(&self) -> Option<&str>
Extract the correlation_id from the packet data.
Sourcepub fn timestamp_us(&self) -> Option<u64>
pub fn timestamp_us(&self) -> Option<u64>
Get the timestamp in microseconds.
Trait Implementations§
Source§impl Clone for TelemetryEvent
impl Clone for TelemetryEvent
Source§fn clone(&self) -> TelemetryEvent
fn clone(&self) -> TelemetryEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TelemetryEvent
impl RefUnwindSafe for TelemetryEvent
impl Send for TelemetryEvent
impl Sync for TelemetryEvent
impl Unpin for TelemetryEvent
impl UnwindSafe for TelemetryEvent
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
Mutably borrows from an owned value. Read more