pub struct GenericRpcToolHandler {
pub plugin_id: String,
pub plugin: Weak<SubprocessNexoPlugin>,
pub rpc_method: String,
pub tool_name: String,
pub timeout: Duration,
}Expand description
ToolHandler impl that dispatches calls to a subprocess
plugin via JSON-RPC.
Fields§
§plugin_id: StringPlugin id (e.g. "telegram"). Used only for diagnostics.
plugin: Weak<SubprocessNexoPlugin>Weak back-ref to the subprocess plugin adapter. Upgrades
to Arc<SubprocessNexoPlugin> on each call; returns
None after the plugin’s outer Arc is dropped (e.g.
hot-unload, daemon shutdown).
rpc_method: StringJSON-RPC method to invoke. Defaults to
"outbound_tool.invoke" per
OutboundToolSpec::default_outbound_rpc_method.
tool_name: StringTool name forwarded as the request’s tool_name field
(so the subprocess can dispatch on it without re-parsing
the request’s method).
timeout: DurationPer-call deadline. Plugin-side timeouts take effect first when the plugin imposes a stricter one; this timeout is the host’s safety net.
Implementations§
Source§impl GenericRpcToolHandler
impl GenericRpcToolHandler
Sourcepub fn new(
plugin_id: impl Into<String>,
plugin: Weak<SubprocessNexoPlugin>,
rpc_method: impl Into<String>,
tool_name: impl Into<String>,
timeout: Duration,
) -> Self
pub fn new( plugin_id: impl Into<String>, plugin: Weak<SubprocessNexoPlugin>, rpc_method: impl Into<String>, tool_name: impl Into<String>, timeout: Duration, ) -> Self
Build a handler bound to a specific subprocess plugin
adapter. The plugin weak ref MUST come from
SubprocessNexoPlugin::weak_self() so respawn cycles
install fresh handlers automatically.
Trait Implementations§
Source§impl ToolHandler for GenericRpcToolHandler
impl ToolHandler for GenericRpcToolHandler
Auto Trait Implementations§
impl !RefUnwindSafe for GenericRpcToolHandler
impl !UnwindSafe for GenericRpcToolHandler
impl Freeze for GenericRpcToolHandler
impl Send for GenericRpcToolHandler
impl Sync for GenericRpcToolHandler
impl Unpin for GenericRpcToolHandler
impl UnsafeUnpin for GenericRpcToolHandler
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more