pub struct ToolArgs {
pub positional: Vec<Value>,
pub named: HashMap<String, Value>,
pub flags: HashSet<String>,
}Expand description
Parsed arguments ready for tool execution.
Fields§
§positional: Vec<Value>Positional arguments in order.
named: HashMap<String, Value>Named arguments by key.
flags: HashSet<String>Boolean flags (e.g., -l, –force).
Implementations§
Source§impl ToolArgs
impl ToolArgs
Sourcepub fn get_positional(&self, index: usize) -> Option<&Value>
pub fn get_positional(&self, index: usize) -> Option<&Value>
Get a positional argument by index.
Sourcepub fn get(&self, name: &str, positional_index: usize) -> Option<&Value>
pub fn get(&self, name: &str, positional_index: usize) -> Option<&Value>
Get a named argument or positional fallback.
Useful for tools that accept both cat file.txt and cat path=file.txt.
Sourcepub fn get_string(&self, name: &str, positional_index: usize) -> Option<String>
pub fn get_string(&self, name: &str, positional_index: usize) -> Option<String>
Get a string value from args.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolArgs
impl RefUnwindSafe for ToolArgs
impl Send for ToolArgs
impl Sync for ToolArgs
impl Unpin for ToolArgs
impl UnsafeUnpin for ToolArgs
impl UnwindSafe for ToolArgs
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