#[repr(C)]pub struct ToolInvocation {
pub tool_id: u32,
pub arg_layout: u64,
pub args_offset: u32,
pub args_len: u32,
}Expand description
Zero-copy tool invocation
Fields§
§tool_id: u32Pre-resolved tool ID (compile-time lookup)
arg_layout: u64Bitfield describing argument positions and types
args_offset: u32Offset into shared memory for arguments
args_len: u32Length of arguments in shared memory
Implementations§
Source§impl ToolInvocation
impl ToolInvocation
Sourcepub const MAX_ARGS: usize = 16
pub const MAX_ARGS: usize = 16
Maximum number of arguments that can be encoded in arg_layout Each argument uses 4 bits for type, so 64 bits / 4 = 16 args
Sourcepub fn new(
tool_id: u32,
arg_layout: u64,
args_offset: u32,
args_len: u32,
) -> Self
pub fn new( tool_id: u32, arg_layout: u64, args_offset: u32, args_len: u32, ) -> Self
Create a new tool invocation
Sourcepub fn get_arg_type(&self, index: usize) -> Option<ArgType>
pub fn get_arg_type(&self, index: usize) -> Option<ArgType>
Get the type of argument at the given index (0-15)
Sourcepub fn set_arg_type(&mut self, index: usize, arg_type: ArgType)
pub fn set_arg_type(&mut self, index: usize, arg_type: ArgType)
Set the type of argument at the given index (0-15)
Trait Implementations§
Source§impl Clone for ToolInvocation
impl Clone for ToolInvocation
Source§fn clone(&self) -> ToolInvocation
fn clone(&self) -> ToolInvocation
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 moreimpl Copy for ToolInvocation
Source§impl Debug for ToolInvocation
impl Debug for ToolInvocation
impl Eq for ToolInvocation
Source§impl PartialEq for ToolInvocation
impl PartialEq for ToolInvocation
Source§fn eq(&self, other: &ToolInvocation) -> bool
fn eq(&self, other: &ToolInvocation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ToolInvocation
Auto Trait Implementations§
impl Freeze for ToolInvocation
impl RefUnwindSafe for ToolInvocation
impl Send for ToolInvocation
impl Sync for ToolInvocation
impl Unpin for ToolInvocation
impl UnsafeUnpin for ToolInvocation
impl UnwindSafe for ToolInvocation
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