pub trait HostCallBridge: Send + Sync {
// Required method
fn dispatch<'a>(
&'a self,
capability: &'a str,
operation: &'a str,
params: &'a DictMap,
) -> HostCallDispatchFuture<'a>;
// Provided methods
fn list_tools(&self) -> Result<Option<VmValue>, VmError> { ... }
fn call_tool(
&self,
_name: &str,
_args: &VmValue,
) -> Result<Option<VmValue>, VmError> { ... }
}Expand description
Embedder-supplied bridge for host_call ops.
Embedders (debug adapters, CLIs, IDE hosts) implement this trait to
satisfy capability/operation pairs that harn-vm itself doesn’t know how
to handle. Returning Ok(None) means “I don’t handle this op — fall
through to the built-in fallbacks (env-derived defaults, then the
unsupported operation error)”. Ok(Some(value)) is the result;
Err(VmError::Thrown(_)) surfaces as a Harn exception.
dispatch returns a Send boxed future so network protocol bridges
(ACP host/call, DAP reverse requests) can await without blocking the
caller. Sync bridges can return host_call_ready.
Required Methods§
fn dispatch<'a>( &'a self, capability: &'a str, operation: &'a str, params: &'a DictMap, ) -> HostCallDispatchFuture<'a>
Provided Methods§
fn list_tools(&self) -> Result<Option<VmValue>, VmError>
fn call_tool( &self, _name: &str, _args: &VmValue, ) -> Result<Option<VmValue>, VmError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".