pub enum WaitOutcome {
Completed(BgAgentResult),
Cancelled,
TimedOut(BgTaskSnapshot),
NotFound,
Forbidden,
}Expand description
Outcome of BgAgentRegistry::wait_for_completion.
Encodes the four resolutions of a WaitTask call. The LLM-tool
layer translates each into a serialised payload the model receives.
Variants§
Completed(BgAgentResult)
Task reached a terminal Completed/Errored status before
the timeout fired. Carries the drained BgAgentResult so
the same payload drain_completed() would have produced is
surfaced directly to the caller. (Drain semantics: a task
consumed via wait_for_completion is removed from pending
so the next drain_completed() won’t double-inject it.)
Cancelled
Task was cancelled (parent token fired, peer cancelled, or the spawned future panicked). The task has been reaped.
TimedOut(BgTaskSnapshot)
Timeout fired before the task reached a terminal state. The
task is still in pending and may still complete on its own.
Carries the most-recent status snapshot so the model can
decide whether to wait again or move on.
NotFound
No task with that id, or caller’s spawner doesn’t match.
Same Forbidden/NotFound distinction as CancelOutcome.
Forbidden
Caller doesn’t own this task.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WaitOutcome
impl RefUnwindSafe for WaitOutcome
impl Send for WaitOutcome
impl Sync for WaitOutcome
impl Unpin for WaitOutcome
impl UnsafeUnpin for WaitOutcome
impl UnwindSafe for WaitOutcome
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
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>
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>
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 more