#[non_exhaustive]pub enum StreamEvent {
Content(String),
Metrics(StreamMetrics),
Completed(ResponseEvidence),
Error(StreamEventError),
}Expand description
One event in a single-turn event stream.
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.
Content(String)
Visible assistant content, in the order the provider sent it.
Metrics(StreamMetrics)
Client timing emitted immediately before terminal evidence, including errors.
Completed(ResponseEvidence)
Terminal success: the provider finished with stop and closed the stream.
The evidence holds the finish reason, usage and provider model when reported, plus other provider metadata such as Ollama durations.
Error(StreamEventError)
Terminal failure. Content yielded before it is not a complete result.
Implementations§
Source§impl StreamEvent
impl StreamEvent
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Whether this event ends the stream.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for StreamEvent
impl !UnwindSafe for StreamEvent
impl Freeze for StreamEvent
impl Send for StreamEvent
impl Sync for StreamEvent
impl Unpin for StreamEvent
impl UnsafeUnpin for StreamEvent
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