pub struct ExtensionTool {
pub tool: Tool,
/* private fields */
}Expand description
A tool an extension registered: the provider-facing Tool schema + the
plugin’s 4-function handle (PluginToolHandle) the host drives via
PluginToolAdapter.
tool is public so the host can merge schemas; handle is crate-private
(only PluginToolAdapter drives it). Clone
derives because Tool is Clone and PluginToolHandle is Copy.
Fields§
§tool: ToolThe provider-facing tool definition (name/description/parameters).
Implementations§
Source§impl ExtensionTool
impl ExtensionTool
pub fn new(tool: Tool, handle: PluginToolHandle) -> Self
Sourcepub fn handle(&self) -> PluginToolHandle
pub fn handle(&self) -> PluginToolHandle
The plugin-side function handles backing this tool. Copy (fn pointers
- a
FreeStringFn), so handing it out is free. Public so the host (e.g. rpi-cli’s session builder) can wrap a registered tool in aPluginToolAdapteroutside this crate.
Trait Implementations§
Source§impl Clone for ExtensionTool
impl Clone for ExtensionTool
Source§fn clone(&self) -> ExtensionTool
fn clone(&self) -> ExtensionTool
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 ExtensionTool
impl RefUnwindSafe for ExtensionTool
impl Send for ExtensionTool
impl Sync for ExtensionTool
impl Unpin for ExtensionTool
impl UnsafeUnpin for ExtensionTool
impl UnwindSafe for ExtensionTool
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