pub struct CancelSignal { /* private fields */ }Expand description
Handles cancellations from a PromptHook in an agentic loop.
Upon using CancelSignal::cancel(), the agent loop will terminate early, providing the messages generated so far.
You can additionally add a reason for early termination with CancelSignal::cancel_with_reason().
Implementations§
Source§impl CancelSignal
impl CancelSignal
pub fn cancel(&self)
pub fn cancel_with_reason(&self, reason: &str)
Trait Implementations§
Source§impl Clone for CancelSignal
impl Clone for CancelSignal
Source§fn clone(&self) -> CancelSignal
fn clone(&self) -> CancelSignal
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 moreAuto Trait Implementations§
impl Freeze for CancelSignal
impl RefUnwindSafe for CancelSignal
impl Send for CancelSignal
impl Sync for CancelSignal
impl Unpin for CancelSignal
impl UnwindSafe for CancelSignal
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