#[non_exhaustive]pub enum TurnEvent {
Phase(TurnPhase),
Step(Box<Step>),
StepSaid {
step: Box<Step>,
text: String,
},
Block(Box<ResponseBlock>),
Completed(Box<AssistantTurn>),
Failed {
code: String,
},
}Expand description
One thing a client learns while a turn is being handled.
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.
Phase(TurnPhase)
The turn moved to a new phase. Progress, never an outcome.
Step(Box<Step>)
One decision of the turn’s understanding, as it was made. What was understood, never what happened: it goes out before the commit, like a phase marker.
StepSaid
A step said in the turn’s language, when NarrationConfig::steps asks for it.
Block(Box<ResponseBlock>)
One finished block, published atomically.
Completed(Box<AssistantTurn>)
The turn is done; this is exactly what was persisted.
Failed
The turn failed, with a stable code and no free text.
Implementations§
Source§impl TurnEvent
impl TurnEvent
Sourcepub fn block(&self) -> Option<&ResponseBlock>
pub fn block(&self) -> Option<&ResponseBlock>
The block this event carries, if any.
Sourcepub const fn is_terminal(&self) -> bool
pub const fn is_terminal(&self) -> bool
Returns true for the two events that end a stream.
Trait Implementations§
impl StructuralPartialEq for TurnEvent
Auto Trait Implementations§
impl Freeze for TurnEvent
impl RefUnwindSafe for TurnEvent
impl Send for TurnEvent
impl Sync for TurnEvent
impl Unpin for TurnEvent
impl UnsafeUnpin for TurnEvent
impl UnwindSafe for TurnEvent
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