pub struct ExecClock { /* private fields */ }Expand description
Per-call execution-clock control, shared between the tool and the
pipeline’s timeout (crate::engine::DefaultPipeline).
The timeout measures active execution time: stretches spent waiting on
a human are excluded (ExecClock::pause), so a tool that asks the user a
question is never killed by its own execution budget while the user is
still reading. Every ToolContext built per call gets a fresh clock —
pauses never leak into a later call.
Implementations§
Source§impl ExecClock
impl ExecClock
Sourcepub fn pause(&self) -> ExecPauseGuard
pub fn pause(&self) -> ExecPauseGuard
Hold the clock paused for as long as the returned guard lives. Nesting is fine: the clock resumes when the outermost guard drops.
Sourcepub fn paused_total(&self) -> Duration
pub fn paused_total(&self) -> Duration
Paused time so far, including the open pause if any. The pipeline’s
deadline is start + budget + paused_total(), so a pause pushes the
timeout out by exactly the time the human spent.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExecClock
impl RefUnwindSafe for ExecClock
impl Send for ExecClock
impl Sync for ExecClock
impl Unpin for ExecClock
impl UnsafeUnpin for ExecClock
impl UnwindSafe for ExecClock
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