pub trait HostHandler: Send + Sync {
// Required method
fn handle(
&self,
kind: &str,
payload: Map<String, Value>,
signal: &Signal,
) -> Result<Value, String>;
}Expand description
Serves host requests from Python (await rlm.host_request(type, payload) and every API built on it). Runs on its
own thread per request; signal is aborted when the requesting cell completes, Python cancels the request, or the
kernel fails. The outcome is still sent while the kernel lives (Python drops one nobody awaits). Err becomes a
RuntimeError with that message in Python.
Required Methods§
fn handle( &self, kind: &str, payload: Map<String, Value>, signal: &Signal, ) -> Result<Value, String>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".