#[non_exhaustive]pub enum KnownStreamEvent {
MessageStart {
message: Message,
},
ContentBlockStart {
index: u32,
content_block: ContentBlock,
},
ContentBlockDelta {
index: u32,
delta: ContentDelta,
},
ContentBlockStop {
index: u32,
},
MessageDelta {
delta: MessageDelta,
usage: Usage,
},
MessageStop,
Ping,
Error {
error: ApiErrorPayload,
},
}Expand description
All streaming event types known to this SDK version.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
MessageStart
Begins a new streamed message; carries the empty Message shell
that subsequent events will fill in.
ContentBlockStart
Begins a new content block within the message.
Fields
§
content_block: ContentBlockInitial state of the block.
ContentBlockDelta
Incremental update to a content block.
ContentBlockStop
Marks a content block as complete.
MessageDelta
Late-arriving updates to message-level fields, plus final usage.
Fields
§
delta: MessageDeltaUpdated message-level fields.
MessageStop
Final event in a successful stream.
Ping
Keep-alive ping; no payload.
Error
Server reported a fatal error mid-stream.
Fields
§
error: ApiErrorPayloadThe error payload.
Trait Implementations§
Source§impl Clone for KnownStreamEvent
impl Clone for KnownStreamEvent
Source§fn clone(&self) -> KnownStreamEvent
fn clone(&self) -> KnownStreamEvent
Returns a duplicate of the value. Read more
1.0.0 · 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 KnownStreamEvent
impl Debug for KnownStreamEvent
Source§impl<'de> Deserialize<'de> for KnownStreamEvent
impl<'de> Deserialize<'de> for KnownStreamEvent
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 From<KnownStreamEvent> for StreamEvent
impl From<KnownStreamEvent> for StreamEvent
Source§fn from(k: KnownStreamEvent) -> Self
fn from(k: KnownStreamEvent) -> Self
Converts to this type from the input type.
Source§impl PartialEq for KnownStreamEvent
impl PartialEq for KnownStreamEvent
Source§impl Serialize for KnownStreamEvent
impl Serialize for KnownStreamEvent
impl StructuralPartialEq for KnownStreamEvent
Auto Trait Implementations§
impl Freeze for KnownStreamEvent
impl RefUnwindSafe for KnownStreamEvent
impl Send for KnownStreamEvent
impl Sync for KnownStreamEvent
impl Unpin for KnownStreamEvent
impl UnsafeUnpin for KnownStreamEvent
impl UnwindSafe for KnownStreamEvent
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
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.