pub enum UpdateEvent {
StatusUpdate(TaskStatusUpdateEvent),
ArtifactUpdate(TaskArtifactUpdateEvent),
}Expand description
Union type for different kinds of updates that can be streamed
Variants§
StatusUpdate(TaskStatusUpdateEvent)
ArtifactUpdate(TaskArtifactUpdateEvent)
Implementations§
Source§impl UpdateEvent
impl UpdateEvent
Sourcepub fn context_id(&self) -> &str
pub fn context_id(&self) -> &str
Get the context ID from the update event
Sourcepub fn settles_task(&self) -> bool
pub fn settles_task(&self) -> bool
Whether this event settles the task, and so ends a subscription.
True for a status update that reaches a terminal state (COMPLETED,
FAILED, CANCELED, REJECTED) or an interrupted one
(INPUT_REQUIRED, AUTH_REQUIRED). Both mean the agent has stopped and
will emit nothing further until the caller acts — and leaving the stream
open on an interrupted state is the worse of the two, because then the
client waits on the agent while the agent waits on the client.
An artifact update never settles a task, including its last chunk:
last_chunk marks the end of that artifact, and a task may emit
several while still WORKING. Conflating the two ends the stream
mid-task, which is why this is not the same predicate as “is this the
last piece of something”.
A2A v1.0 has no final flag on TaskStatusUpdateEvent (v0.x did), so
the end of a stream is derived from the task state and nowhere else.
Trait Implementations§
Source§impl Clone for UpdateEvent
impl Clone for UpdateEvent
Source§fn clone(&self) -> UpdateEvent
fn clone(&self) -> UpdateEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for UpdateEvent
impl RefUnwindSafe for UpdateEvent
impl Send for UpdateEvent
impl Sync for UpdateEvent
impl Unpin for UpdateEvent
impl UnsafeUnpin for UpdateEvent
impl UnwindSafe for UpdateEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more