pub trait Protocol:
Send
+ Sync
+ 'static {
type Request: Serialize + DeserializeOwned + Send + 'static;
type Response: Serialize + DeserializeOwned + Send + 'static;
}Expand description
A family of messages exchanged by one RPC session.
Implement this marker trait once for each application protocol version represented by distinct Rust request and response types. Both peers must bind the negotiated connection to compatible implementations.
Required Associated Types§
Sourcetype Request: Serialize + DeserializeOwned + Send + 'static
type Request: Serialize + DeserializeOwned + Send + 'static
Messages sent by client::Client calls and received by
server::Server handlers.
Sourcetype Response: Serialize + DeserializeOwned + Send + 'static
type Response: Serialize + DeserializeOwned + Send + 'static
Messages returned by server::Server handlers and yielded by
completed client::Calls.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".