pub struct ToolExecutor { /* private fields */ }Expand description
Tool Executor
Executes tool calls through the transport layer with support for timeout, retry, and proper error handling.
Implementations§
Source§impl ToolExecutor
impl ToolExecutor
Sourcepub fn new(router: Arc<ToolRouter>, registry: Arc<RegistryService>) -> Self
pub fn new(router: Arc<ToolRouter>, registry: Arc<RegistryService>) -> Self
Create a new tool executor
Sourcepub fn with_config(
router: Arc<ToolRouter>,
registry: Arc<RegistryService>,
config: ExecutionConfig,
) -> Self
pub fn with_config( router: Arc<ToolRouter>, registry: Arc<RegistryService>, config: ExecutionConfig, ) -> Self
Create with custom configuration
Sourcepub async fn execute(
&self,
tool_name: &str,
params: Value,
) -> Result<Value, ToolExecutorError>
pub async fn execute( &self, tool_name: &str, params: Value, ) -> Result<Value, ToolExecutorError>
Execute a tool call
Routes the call to the appropriate service and executes it with timeout and retry support.
Sourcepub async fn execute_with_id(
&self,
tool_name: &str,
params: Value,
request_id: JsonRpcId,
) -> Result<Value, ToolExecutorError>
pub async fn execute_with_id( &self, tool_name: &str, params: Value, request_id: JsonRpcId, ) -> Result<Value, ToolExecutorError>
Execute a tool call with a specific request ID
Sourcepub async fn register_connection(
&self,
service_id: ServiceId,
_transport: StdioTransport,
)
pub async fn register_connection( &self, service_id: ServiceId, _transport: StdioTransport, )
Register a transport connection for a service
Sourcepub async fn remove_connection(&self, service_id: &ServiceId)
pub async fn remove_connection(&self, service_id: &ServiceId)
Remove a transport connection
Sourcepub async fn is_connected(&self, service_id: &ServiceId) -> bool
pub async fn is_connected(&self, service_id: &ServiceId) -> bool
Check if a service is connected
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ToolExecutor
impl !RefUnwindSafe for ToolExecutor
impl !UnwindSafe for ToolExecutor
impl Send for ToolExecutor
impl Sync for ToolExecutor
impl Unpin for ToolExecutor
impl UnsafeUnpin for ToolExecutor
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