pub struct AgentEventRecord {
pub schema_version: u16,
pub run_id: Option<String>,
pub sequence: Option<u64>,
pub timestamp: SystemTime,
pub name: String,
pub severity: EventSeverity,
pub payload: Value,
pub redactions: Vec<RedactionRecord>,
}Expand description
Serializable, redacted event record for out-of-process observers.
AgentEventRecord complements the low-cost Arc<dyn AgentEvent> channel:
framework-owned events can expose sanitized JSON summaries, while custom
events may keep returning None from AgentEvent::to_record.
Fields§
§schema_version: u16Record schema version. Starts at 1; payload additions should be backward-compatible.
run_id: Option<String>Run id when the event has one.
sequence: Option<u64>Optional producer-local sequence number.
timestamp: SystemTimeRecord creation timestamp.
name: StringEvent name.
severity: EventSeverityEvent severity.
payload: ValueRedacted, event-specific summary payload.
redactions: Vec<RedactionRecord>Redactions or omitted raw-content fields.
Implementations§
Source§impl AgentEventRecord
impl AgentEventRecord
Sourcepub fn new(
name: impl Into<String>,
severity: EventSeverity,
payload: Value,
) -> Self
pub fn new( name: impl Into<String>, severity: EventSeverity, payload: Value, ) -> Self
Constructs a record with the current schema version and timestamp.
Sourcepub fn with_run_id(self, run_id: impl Into<String>) -> Self
pub fn with_run_id(self, run_id: impl Into<String>) -> Self
Sets the run id.
Sourcepub fn with_sequence(self, sequence: u64) -> Self
pub fn with_sequence(self, sequence: u64) -> Self
Sets the optional sequence number.
Sourcepub fn with_redactions(self, redactions: Vec<RedactionRecord>) -> Self
pub fn with_redactions(self, redactions: Vec<RedactionRecord>) -> Self
Sets redaction records.
Trait Implementations§
Source§impl Clone for AgentEventRecord
impl Clone for AgentEventRecord
Source§fn clone(&self) -> AgentEventRecord
fn clone(&self) -> AgentEventRecord
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 AgentEventRecord
impl Debug for AgentEventRecord
Source§impl<'de> Deserialize<'de> for AgentEventRecord
impl<'de> Deserialize<'de> for AgentEventRecord
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
Source§impl PartialEq for AgentEventRecord
impl PartialEq for AgentEventRecord
Source§impl Serialize for AgentEventRecord
impl Serialize for AgentEventRecord
impl StructuralPartialEq for AgentEventRecord
Auto Trait Implementations§
impl Freeze for AgentEventRecord
impl RefUnwindSafe for AgentEventRecord
impl Send for AgentEventRecord
impl Sync for AgentEventRecord
impl Unpin for AgentEventRecord
impl UnsafeUnpin for AgentEventRecord
impl UnwindSafe for AgentEventRecord
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