pub struct AgentStreamRecord {
pub sequence: usize,
pub source: Option<AgentStreamSource>,
pub event: AgentStreamEvent,
}Expand description
Sequenced stream event record.
Fields§
§sequence: usizeMonotonic event sequence number within one run.
source: Option<AgentStreamSource>Source attribution for records merged from nested runs.
event: AgentStreamEventTyped event payload.
Implementations§
Source§impl AgentStreamRecord
impl AgentStreamRecord
Sourcepub const fn new(sequence: usize, event: AgentStreamEvent) -> Self
pub const fn new(sequence: usize, event: AgentStreamEvent) -> Self
Create a sequenced stream record.
Sourcepub fn with_source(self, source: AgentStreamSource) -> Self
pub fn with_source(self, source: AgentStreamSource) -> Self
Attach source attribution.
Sourcepub const fn with_sequence(self, sequence: usize) -> Self
pub const fn with_sequence(self, sequence: usize) -> Self
Replace the parent stream sequence after merging into another stream.
Sourcepub fn to_raw_json(&self) -> Result<Value>
pub fn to_raw_json(&self) -> Result<Value>
Project this raw runtime stream record into its JSON representation.
§Errors
Returns a serialization error if a nested event payload cannot be encoded.
Trait Implementations§
Source§impl Clone for AgentStreamRecord
impl Clone for AgentStreamRecord
Source§fn clone(&self) -> AgentStreamRecord
fn clone(&self) -> AgentStreamRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentStreamRecord
impl Debug for AgentStreamRecord
Source§impl<'de> Deserialize<'de> for AgentStreamRecord
impl<'de> Deserialize<'de> for AgentStreamRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AgentStreamRecord
Source§impl PartialEq for AgentStreamRecord
impl PartialEq for AgentStreamRecord
Source§fn eq(&self, other: &AgentStreamRecord) -> bool
fn eq(&self, other: &AgentStreamRecord) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AgentStreamRecord
impl Serialize for AgentStreamRecord
impl StructuralPartialEq for AgentStreamRecord
Auto Trait Implementations§
impl Freeze for AgentStreamRecord
impl RefUnwindSafe for AgentStreamRecord
impl Send for AgentStreamRecord
impl Sync for AgentStreamRecord
impl Unpin for AgentStreamRecord
impl UnsafeUnpin for AgentStreamRecord
impl UnwindSafe for AgentStreamRecord
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