Skip to main content

Service

Trait Service 

Source
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§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Q, S> Service for AService<Q, S>
where Q: Message, S: Message,