pub enum ToolState {
Completed(ToolStateCompleted),
Error(ToolStateError),
Running(ToolStateRunning),
Pending(ToolStatePending),
Unknown(Value),
}Expand description
State of a tool execution (untagged enum with Unknown fallback).
Variant order matters for untagged enums - most specific variants with more required fields must come first to avoid less specific variants matching early.
Variants§
Completed(ToolStateCompleted)
Tool completed successfully.
Error(ToolStateError)
Tool encountered an error.
Running(ToolStateRunning)
Tool is currently running.
Pending(ToolStatePending)
Tool is pending execution.
Unknown(Value)
Unknown state (forward compatibility).
Implementations§
Source§impl ToolState
impl ToolState
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Check if the tool is pending.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the tool is running.
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Check if the tool completed successfully.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolState
impl<'de> Deserialize<'de> for ToolState
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
Auto Trait Implementations§
impl Freeze for ToolState
impl RefUnwindSafe for ToolState
impl Send for ToolState
impl Sync for ToolState
impl Unpin for ToolState
impl UnwindSafe for ToolState
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