pub struct ToolDispatch {
pub max_concurrency: usize,
pub capability_mode: CapabilityMode,
pub approval: Arc<dyn ApprovalGate>,
pub approval_policy: ApprovalPolicy,
pub metrics: SharedMetrics,
}Expand description
Scheduler for tool batches.
Fields§
§max_concurrency: usizeMaximum concurrent non-exclusive tools.
capability_mode: CapabilityModeCapability filter applied before execution.
approval: Arc<dyn ApprovalGate>Host approval gate.
approval_policy: ApprovalPolicyWhen to invoke approval.
metrics: SharedMetricsMetrics sink (default no-op).
Implementations§
Source§impl ToolDispatch
impl ToolDispatch
Sourcepub fn with_capability(self, mode: CapabilityMode) -> Self
pub fn with_capability(self, mode: CapabilityMode) -> Self
Builder: capability mode.
Sourcepub const fn with_max_concurrency(self, n: usize) -> Self
pub const fn with_max_concurrency(self, n: usize) -> Self
Builder: max concurrency.
Sourcepub fn with_approval(self, gate: Arc<dyn ApprovalGate>) -> Self
pub fn with_approval(self, gate: Arc<dyn ApprovalGate>) -> Self
Builder: approval gate.
Sourcepub const fn with_approval_policy(self, policy: ApprovalPolicy) -> Self
pub const fn with_approval_policy(self, policy: ApprovalPolicy) -> Self
Builder: approval policy.
Sourcepub fn with_metrics(self, metrics: SharedMetrics) -> Self
pub fn with_metrics(self, metrics: SharedMetrics) -> Self
Builder: metrics sink.
Sourcepub async fn execute_batch(
&self,
registry: &ToolRegistry,
ctx: ToolCallContext,
requests: Vec<DispatchRequest>,
) -> Vec<DispatchOutcome>
pub async fn execute_batch( &self, registry: &ToolRegistry, ctx: ToolCallContext, requests: Vec<DispatchRequest>, ) -> Vec<DispatchOutcome>
Execute a batch preserving input order in the output vector.
Trait Implementations§
Source§impl Clone for ToolDispatch
impl Clone for ToolDispatch
Source§fn clone(&self) -> ToolDispatch
fn clone(&self) -> ToolDispatch
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 moreSource§impl Debug for ToolDispatch
impl Debug for ToolDispatch
Auto Trait Implementations§
impl !RefUnwindSafe for ToolDispatch
impl !UnwindSafe for ToolDispatch
impl Freeze for ToolDispatch
impl Send for ToolDispatch
impl Sync for ToolDispatch
impl Unpin for ToolDispatch
impl UnsafeUnpin for ToolDispatch
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