pub enum TokenEvent {
Token(String),
Done {
stop_reason: StopReason,
usage: Usage,
},
}Expand description
One event in a generation stream.
A successful generation produces zero or more Token events terminated by
exactly one Done. A failed generation produces zero or more Token
events followed by no further events; the adapter returns the failure as
a GenerateError from generate() (pre-stream) or terminates the stream
without a Done (mid-stream) — see ADR 0007 for the failure-semantics
contract.
Variants§
Trait Implementations§
Source§impl Clone for TokenEvent
impl Clone for TokenEvent
Source§fn clone(&self) -> TokenEvent
fn clone(&self) -> TokenEvent
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 TokenEvent
impl Debug for TokenEvent
Source§impl PartialEq for TokenEvent
impl PartialEq for TokenEvent
Source§fn eq(&self, other: &TokenEvent) -> bool
fn eq(&self, other: &TokenEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for TokenEvent
impl StructuralPartialEq for TokenEvent
Auto Trait Implementations§
impl Freeze for TokenEvent
impl RefUnwindSafe for TokenEvent
impl Send for TokenEvent
impl Sync for TokenEvent
impl Unpin for TokenEvent
impl UnsafeUnpin for TokenEvent
impl UnwindSafe for TokenEvent
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