pub struct EnhancedToolRegistry { /* private fields */ }Expand description
Enhanced tool registry with circuit breaker, retry, and timeout
Implementations§
Source§impl EnhancedToolRegistry
impl EnhancedToolRegistry
pub fn new() -> Self
Sourcepub fn with_circuit_breaker(self, config: CircuitBreakerConfig) -> Self
pub fn with_circuit_breaker(self, config: CircuitBreakerConfig) -> Self
Configure default circuit breaker settings
Sourcepub fn with_retry(self, config: RetryConfig) -> Self
pub fn with_retry(self, config: RetryConfig) -> Self
Configure default retry settings
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Configure default timeout
Sourcepub fn register_with_config(
&self,
tool: Arc<dyn Tool>,
circuit_config: CircuitBreakerConfig,
retry_config: RetryConfig,
timeout_duration: Duration,
)
pub fn register_with_config( &self, tool: Arc<dyn Tool>, circuit_config: CircuitBreakerConfig, retry_config: RetryConfig, timeout_duration: Duration, )
Register a tool with custom settings
Sourcepub async fn execute(
&self,
name: &str,
context: &ExecutionContext,
arguments: Value,
) -> Result<Value, ToolError>
pub async fn execute( &self, name: &str, context: &ExecutionContext, arguments: Value, ) -> Result<Value, ToolError>
Execute a tool with circuit breaker, retry, and timeout
Sourcepub fn list_schemas(&self) -> Vec<ToolSchema>
pub fn list_schemas(&self) -> Vec<ToolSchema>
List all tool schemas
Sourcepub fn get_circuit_state(&self, name: &str) -> Option<CircuitState>
pub fn get_circuit_state(&self, name: &str) -> Option<CircuitState>
Get circuit state for a tool
Sourcepub fn reset_circuit(&self, name: &str) -> bool
pub fn reset_circuit(&self, name: &str) -> bool
Reset circuit breaker for a tool
Sourcepub fn reset_all_circuits(&self)
pub fn reset_all_circuits(&self)
Reset all circuit breakers
Sourcepub fn print_health_report(&self)
pub fn print_health_report(&self)
Print tool health report
Trait Implementations§
Source§impl Clone for EnhancedToolRegistry
impl Clone for EnhancedToolRegistry
Auto Trait Implementations§
impl Freeze for EnhancedToolRegistry
impl !RefUnwindSafe for EnhancedToolRegistry
impl Send for EnhancedToolRegistry
impl Sync for EnhancedToolRegistry
impl Unpin for EnhancedToolRegistry
impl UnsafeUnpin for EnhancedToolRegistry
impl !UnwindSafe for EnhancedToolRegistry
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