pub enum TurnResult<'a, 'h, Ctx: LoopDepth + Send + Sync + 'static> {
Yielded(Yielded<'a, 'h, Ctx>),
Completed(Completed),
Error(TurnError),
}Expand description
Result of one turn of the tool loop.
Match on this to determine what happened and what you can do next.
Each variant carries the data from the turn AND (for Yielded) a handle
scoped to valid operations for that state.
This follows the same pattern as std::collections::hash_map::Entry —
the variant gives you exactly the methods that make sense for that state.
Variants§
Yielded(Yielded<'a, 'h, Ctx>)
Tools were executed. The caller MUST consume this via resume(),
continue_loop(), inject_and_continue(), or stop().
While this variant exists, the ToolLoopHandle is mutably borrowed
and cannot be used directly. Consuming the Yielded releases the
borrow.
Completed(Completed)
The loop completed (no tool calls, stop condition, max iterations, or timeout).
Error(TurnError)
An unrecoverable error occurred.
Auto Trait Implementations§
impl<'a, 'h, Ctx> Freeze for TurnResult<'a, 'h, Ctx>
impl<'a, 'h, Ctx> !RefUnwindSafe for TurnResult<'a, 'h, Ctx>
impl<'a, 'h, Ctx> Send for TurnResult<'a, 'h, Ctx>
impl<'a, 'h, Ctx> Sync for TurnResult<'a, 'h, Ctx>
impl<'a, 'h, Ctx> Unpin for TurnResult<'a, 'h, Ctx>
impl<'a, 'h, Ctx> !UnwindSafe for TurnResult<'a, 'h, Ctx>
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