pub enum Event {
Task(Task),
Message(Message),
StatusUpdate(TaskStatusUpdateEvent),
ArtifactUpdate(TaskArtifactUpdateEvent),
}Expand description
A unified event type for streaming responses.
Aligned with Go’s Event interface — represents any event that can be
sent over a streaming connection.
Uses the "kind" discriminator for deserialization, matching Go’s
UnmarshalEventJSON. Serialization delegates to each variant’s custom
Serialize impl which injects "kind" automatically.
Variants§
Task(Task)
A complete task snapshot.
Message(Message)
A direct message.
StatusUpdate(TaskStatusUpdateEvent)
A status change notification.
ArtifactUpdate(TaskArtifactUpdateEvent)
An artifact creation/update notification.
Implementations§
Source§impl Event
impl Event
Sourcepub fn context_id(&self) -> &str
pub fn context_id(&self) -> &str
Returns the context ID associated with this event.
Sourcepub fn is_final(&self) -> bool
pub fn is_final(&self) -> bool
Returns true if this is a final/terminal event (execution should stop after this).
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Returns true if the event represents a terminal condition that should
stop the non-streaming event collection loop. Aligned with Go’s
shouldInterruptNonStreaming + final-event detection.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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