pub trait WorkerProtocolHandler {
// Provided method
fn dispatch(
&self,
opcode: &WorkerOpcode,
body: &[u8],
) -> Result<Vec<u8>, String> { ... }
}Expand description
Abstract handler for the worker protocol’s server side. Each
opcode dispatches to a corresponding method here; the default
implementation returns a typed unhandled-opcode error so an
incomplete handler surfaces missing opcodes loudly.
In production, sui-daemon implements this trait against its real store. Tests can provide a mock that records dispatched opcodes for verification.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".