quic_rpc::pattern::rpc

Trait RpcMsg

Source
pub trait RpcMsg<S: Service>: Msg<S, Pattern = Rpc> {
    type Response: Into<S::Res> + TryFrom<S::Res> + Send + 'static;
}
Expand description

Defines the response type for a rpc message.

Since this is the most common interaction pattern, this also implements Msg for you automatically, with the interaction pattern set to Rpc. This is to reduce boilerplate when defining rpc messages.

Required Associated Types§

Source

type Response: Into<S::Res> + TryFrom<S::Res> + Send + 'static

The type for the response

For requests that can produce errors, this can be set to Result<T, E>.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§