pub trait WorkerProtocol {
type Incoming: Serialize + DeserializeOwned + 'static;
type Outgoing: Serialize + DeserializeOwned + Send + Sync + 'static;
}Expand description
The application message pair a page and its worker speak over the
APP_KEY envelope field, from the worker’s point of view:
Incoming arrives from the page, Outgoing returns to it. The control
plane (init, resize, input, picking, status) is not part of the
protocol; the host owns it. Both types serialize and deserialize
because each crosses the wire in one direction and is decoded on the
other side.
Required Associated Types§
type Incoming: Serialize + DeserializeOwned + 'static
type Outgoing: Serialize + DeserializeOwned + Send + Sync + 'static
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".