pub struct RegisteredTool {
pub spec: ToolSpec,
pub handler: Arc<dyn ToolHandler>,
}Expand description
Spec + linked handler pair registered at runtime startup.
Fields§
§spec: ToolSpecCanonical specification.
handler: Arc<dyn ToolHandler>Linked implementation.
Implementations§
Source§impl RegisteredTool
impl RegisteredTool
Sourcepub fn new(spec: ToolSpec, handler: Arc<dyn ToolHandler>) -> Self
pub fn new(spec: ToolSpec, handler: Arc<dyn ToolHandler>) -> Self
Construct a registered tool.
Prefer Self::try_new so cancellation policy is checked against the handler.
Sourcepub fn try_new(
spec: ToolSpec,
handler: Arc<dyn ToolHandler>,
) -> Result<Self, StartupError>
pub fn try_new( spec: ToolSpec, handler: Arc<dyn ToolHandler>, ) -> Result<Self, StartupError>
Construct a registered tool, rejecting unstoppable / mismatched policy (D-024).
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 !RefUnwindSafe for RegisteredTool
impl !UnwindSafe for RegisteredTool
impl Freeze for RegisteredTool
impl Send for RegisteredTool
impl Sync for RegisteredTool
impl Unpin for RegisteredTool
impl UnsafeUnpin 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