pub struct SpeculativeHandle {
pub key: HandleKey,
pub join: BlockingHandle<Result<Option<ToolOutput>, ToolError>>,
pub cancel: CancellationToken,
pub ttl_deadline: Instant,
pub started_at: Instant,
}Expand description
An in-flight speculative execution handle.
Created when the engine dispatches a speculative tool call. Committed when the LLM
confirms the same call on ToolUseStop; cancelled on mismatch or TTL expiry.
Fields§
§key: HandleKey§join: BlockingHandle<Result<Option<ToolOutput>, ToolError>>§cancel: CancellationToken§ttl_deadline: InstantAbsolute wall-clock deadline; handle is cancelled by the sweeper when exceeded.
started_at: InstantImplementations§
Source§impl SpeculativeHandle
impl SpeculativeHandle
Sourcepub async fn commit(self) -> Result<Option<ToolOutput>, ToolError>
pub async fn commit(self) -> Result<Option<ToolOutput>, ToolError>
Await the result; blocks until the task finishes or is cancelled.
§Errors
Returns ToolError::Execution if the task was cancelled or panicked.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SpeculativeHandle
impl !UnwindSafe for SpeculativeHandle
impl Freeze for SpeculativeHandle
impl Send for SpeculativeHandle
impl Sync for SpeculativeHandle
impl Unpin for SpeculativeHandle
impl UnsafeUnpin for SpeculativeHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request