pub struct PendingCompletion {
pub deadline: Option<Duration>,
pub on_timeout: TimeoutBehavior,
pub on_cancel: CancelHint,
}Expand description
Configuration carried by a ToolResult::Pending result: how long the runtime
waits for the deferred outcome, and what to do if it times out or is cancelled.
Defaults to no deadline, TimeoutBehavior::ErrorAsResult, and
CancelHint::CancelExternalWork. Build one with PendingCompletion::new and
the with_* adjusters.
Fields§
§deadline: Option<Duration>Maximum time to wait for the deferred outcome. None waits indefinitely (until
the turn or process is otherwise cancelled).
on_timeout: TimeoutBehaviorWhat the runtime does when deadline elapses without a resolution.
on_cancel: CancelHintWhat the runtime signals about out-of-band work if the call is cancelled.
Implementations§
Source§impl PendingCompletion
impl PendingCompletion
pub fn new() -> Self
pub fn with_deadline(self, deadline: Duration) -> Self
pub fn fail_turn_on_timeout(self) -> Self
Trait Implementations§
Source§impl Clone for PendingCompletion
impl Clone for PendingCompletion
Source§fn clone(&self) -> PendingCompletion
fn clone(&self) -> PendingCompletion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PendingCompletion
impl Debug for PendingCompletion
Source§impl Default for PendingCompletion
impl Default for PendingCompletion
Source§impl<'de> Deserialize<'de> for PendingCompletion
impl<'de> Deserialize<'de> for PendingCompletion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PendingCompletion
impl PartialEq for PendingCompletion
Source§fn eq(&self, other: &PendingCompletion) -> bool
fn eq(&self, other: &PendingCompletion) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PendingCompletion
impl Serialize for PendingCompletion
impl StructuralPartialEq for PendingCompletion
Auto Trait Implementations§
impl Freeze for PendingCompletion
impl RefUnwindSafe for PendingCompletion
impl Send for PendingCompletion
impl Sync for PendingCompletion
impl Unpin for PendingCompletion
impl UnsafeUnpin for PendingCompletion
impl UnwindSafe for PendingCompletion
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