pub trait HostServices: Send + Sync {
// Required methods
fn call(&self, service: &str, request: &[u8]) -> Result<Vec<u8>, String>;
fn notify(&self, service: &str, payload: &[u8]);
}Expand description
Services a host exposes to the components it loads.
The host owns the meaning of service names and payload bytes; the ABI only moves bytes.
Components may call from any thread, so implementations must be thread-safe. A panic in an
implementation is caught at the FFI boundary and reported to the component as an error
status, never unwound across it.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".