#[non_exhaustive]pub struct RegisteredTool {
pub tool: Arc<dyn Tool>,
pub binding: Arc<dyn Binding>,
pub semaphore: Arc<Semaphore>,
}Expand description
One registered tool plus the binding dispatch uses to execute it.
SP-12 Task 4: Binding sits between dispatch and the Tool impl so
the same tool can be served via different execution strategies
(in-process, CLI subprocess, future MCP / REST / AppFunction).
SP-operability-v1 C2: semaphore enforces max_concurrent at
dispatch time via try_acquire_owned — saturation returns 1002
before the tool runs. Sized from
tool.definition().resources.max_concurrent: a positive value gives
that many permits, 0 maps to Semaphore::MAX_PERMITS (effectively
unlimited). #[non_exhaustive] is load-bearing — downstream code
goes through Registry::register* so new fields can be added here
without breaking external struct-literal callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tool: Arc<dyn Tool>§binding: Arc<dyn Binding>§semaphore: Arc<Semaphore>Implementations§
Source§impl RegisteredTool
impl RegisteredTool
pub fn definition(&self) -> &ToolDefinition
Trait Implementations§
Source§impl Clone for RegisteredTool
impl Clone for RegisteredTool
Source§fn clone(&self) -> RegisteredTool
fn clone(&self) -> RegisteredTool
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 moreAuto Trait Implementations§
impl Freeze for RegisteredTool
impl !RefUnwindSafe for RegisteredTool
impl Send for RegisteredTool
impl Sync for RegisteredTool
impl Unpin for RegisteredTool
impl UnsafeUnpin for RegisteredTool
impl !UnwindSafe for RegisteredTool
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