pub struct RegisteredTool { /* private fields */ }Expand description
Spec + linked handler pair registered at runtime startup.
Fields are private so callers cannot bypass Self::try_new /
Self::try_new_abortable / Self::try_new_process_isolated via struct
literals (V2 §14.2–14.3 / D-043 / D-050).
Implementations§
Source§impl RegisteredTool
impl RegisteredTool
Sourcepub fn handler(&self) -> &Arc<dyn ToolHandler> ⓘ
pub fn handler(&self) -> &Arc<dyn ToolHandler> ⓘ
Linked implementation.
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 / Self::try_new_abortable /
Self::try_new_process_isolated so cancellation policy is checked.
Panics if the class/handler pair is invalid.
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 class (D-024).
Abortable and ProcessIsolated tools MUST use their structural factories —
Self::try_new_abortable and Self::try_new_process_isolated — so a
dyn ToolHandler cannot self-assert those classes via capability booleans.
Sourcepub fn try_new_abortable<H>(
spec: ToolSpec,
handler: H,
) -> Result<Self, StartupError>where
H: AbortableAtYieldHandler + 'static,
pub fn try_new_abortable<H>(
spec: ToolSpec,
handler: H,
) -> Result<Self, StartupError>where
H: AbortableAtYieldHandler + 'static,
Structural AbortableAtYield registration (V2 §14.2 / D-050).
Only a sealed AbortableAtYieldHandler (crate AsyncToolHandler /
IsolatedKillableToolHandler) may satisfy this class — capability
booleans on dyn ToolHandler are rejected.
Sourcepub fn try_new_process_isolated(
spec: ToolSpec,
handler: ProcessIsolatedToolHandler,
) -> Result<Self, StartupError>
pub fn try_new_process_isolated( spec: ToolSpec, handler: ProcessIsolatedToolHandler, ) -> Result<Self, StartupError>
Structural ProcessIsolated registration (V2 §14.3 / D-043).
Only a concrete super::process_tool::ProcessIsolatedToolHandler may
satisfy this class — capability booleans on dyn ToolHandler are rejected.
Trait Implementations§
Source§impl Clone for RegisteredTool
impl Clone for RegisteredTool
Source§fn clone(&self) -> RegisteredTool
fn clone(&self) -> RegisteredTool
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more