pub struct SystemMessage {
pub subtype: SystemSubtype,
pub data: Value,
}Expand description
System message with metadata
Fields§
§subtype: SystemSubtype§data: ValueImplementations§
Source§impl SystemMessage
impl SystemMessage
Sourcepub fn is_compact_boundary(&self) -> bool
pub fn is_compact_boundary(&self) -> bool
Check if this is a compact_boundary message
Sourcepub fn as_init(&self) -> Option<InitMessage>
pub fn as_init(&self) -> Option<InitMessage>
Try to parse as an init message
Sourcepub fn as_status(&self) -> Option<StatusMessage>
pub fn as_status(&self) -> Option<StatusMessage>
Try to parse as a status message
Sourcepub fn as_compact_boundary(&self) -> Option<CompactBoundaryMessage>
pub fn as_compact_boundary(&self) -> Option<CompactBoundaryMessage>
Try to parse as a compact_boundary message
Sourcepub fn is_task_started(&self) -> bool
pub fn is_task_started(&self) -> bool
Check if this is a task_started message
Sourcepub fn is_task_progress(&self) -> bool
pub fn is_task_progress(&self) -> bool
Check if this is a task_progress message
Sourcepub fn is_task_notification(&self) -> bool
pub fn is_task_notification(&self) -> bool
Check if this is a task_notification message
Sourcepub fn as_task_started(&self) -> Option<TaskStartedMessage>
pub fn as_task_started(&self) -> Option<TaskStartedMessage>
Try to parse as a task_started message
Sourcepub fn as_task_progress(&self) -> Option<TaskProgressMessage>
pub fn as_task_progress(&self) -> Option<TaskProgressMessage>
Try to parse as a task_progress message
Sourcepub fn as_task_notification(&self) -> Option<TaskNotificationMessage>
pub fn as_task_notification(&self) -> Option<TaskNotificationMessage>
Try to parse as a task_notification message
Sourcepub fn is_task_updated(&self) -> bool
pub fn is_task_updated(&self) -> bool
Check if this is a task_updated message
Sourcepub fn as_task_updated(&self) -> Option<TaskUpdatedMessage>
pub fn as_task_updated(&self) -> Option<TaskUpdatedMessage>
Try to parse as a task_updated message
Sourcepub fn is_thinking_tokens(&self) -> bool
pub fn is_thinking_tokens(&self) -> bool
Check if this is a thinking_tokens message
Sourcepub fn as_thinking_tokens(&self) -> Option<ThinkingTokensMessage>
pub fn as_thinking_tokens(&self) -> Option<ThinkingTokensMessage>
Try to parse as a thinking_tokens message
Sourcepub fn typed_value(&self) -> Option<Value>
pub fn typed_value(&self) -> Option<Value>
Re-serialize this system message’s payload through the typed view that
matches its subtype, returning the result as JSON.
Used by the wrapping audit (crate::io::audit_frame) to verify that a
subtype’s dedicated struct captures every wire field: the audit compares
this against the raw SystemMessage::data. Returns None for subtypes
this crate version has no dedicated struct for (including
SystemSubtype::Unknown) — those are reported as not fully wrapped.
Trait Implementations§
Source§impl Clone for SystemMessage
impl Clone for SystemMessage
Source§fn clone(&self) -> SystemMessage
fn clone(&self) -> SystemMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more