pub trait Service {
type Request: Message;
type Response: Message;
// Required methods
fn request_type_name(&self) -> &str;
fn response_type_name(&self) -> &str;
}Expand description
Service trait pairs the Request and Response types together. Additionally, it ensures that Response and Request are Messages (Serializable), and we have a means to name the types.
Required Associated Types§
Required Methods§
fn request_type_name(&self) -> &str
fn response_type_name(&self) -> &str
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".