pub enum TaskPushNotification {
StatusUpdate {
id: String,
status: TaskStatus,
error: Option<String>,
},
ArtifactUpdate {
id: String,
artifact: A2ATaskResult,
},
}Expand description
A push notification emitted by a streaming A2A server (P2-1).
Sent over an SSE connection as data: <json> lines, discriminated by the
kind field. Mirrors the A2A TaskStatusUpdateEvent /
TaskArtifactUpdateEvent pair.
Variants§
StatusUpdate
A task status transition (e.g. submitted → working, or a terminal
state). Carries an optional error message when the status is failed.
Fields
§
status: TaskStatusNew status.
ArtifactUpdate
A chunk of partial output while the task is still working.
Implementations§
Source§impl TaskPushNotification
impl TaskPushNotification
Sourcepub fn status(id: impl Into<String>, status: TaskStatus) -> Self
pub fn status(id: impl Into<String>, status: TaskStatus) -> Self
Create a status-update notification.
Sourcepub fn status_with_error(
id: impl Into<String>,
status: TaskStatus,
error: impl Into<String>,
) -> Self
pub fn status_with_error( id: impl Into<String>, status: TaskStatus, error: impl Into<String>, ) -> Self
Create a status-update notification carrying an error message.
Sourcepub fn artifact(id: impl Into<String>, artifact: A2ATaskResult) -> Self
pub fn artifact(id: impl Into<String>, artifact: A2ATaskResult) -> Self
Create an artifact-update notification.
Sourcepub fn status_value(&self) -> Option<TaskStatus>
pub fn status_value(&self) -> Option<TaskStatus>
The current status, if this is a status-update notification.
Trait Implementations§
Source§impl Clone for TaskPushNotification
impl Clone for TaskPushNotification
Source§fn clone(&self) -> TaskPushNotification
fn clone(&self) -> TaskPushNotification
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 TaskPushNotification
impl Debug for TaskPushNotification
Source§impl<'de> Deserialize<'de> for TaskPushNotification
impl<'de> Deserialize<'de> for TaskPushNotification
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
Auto Trait Implementations§
impl Freeze for TaskPushNotification
impl RefUnwindSafe for TaskPushNotification
impl Send for TaskPushNotification
impl Sync for TaskPushNotification
impl Unpin for TaskPushNotification
impl UnsafeUnpin for TaskPushNotification
impl UnwindSafe for TaskPushNotification
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