pub trait ServerEncoding {
// Required method
fn into_dispatch(self) -> DispatchResult;
}Expand description
Trait for encoding server responses into dispatch results.
This trait is automatically implemented for:
Result<T, E>whereT: Serialize- unary responsesResult<RpcStream<T>, E>- streaming responses
The implementations don’t conflict because RpcStream<T> intentionally
does not implement Serialize.
Required Methods§
Sourcefn into_dispatch(self) -> DispatchResult
fn into_dispatch(self) -> DispatchResult
Convert this response into a dispatch result.
Implementations on Foreign Types§
Source§impl<T: Serialize + Unpin + Send + 'static, E: Display> ServerEncoding for Result<RpcStream<T>, E>
Streaming response encoding for RpcStream results.
This impl doesn’t conflict with the above because RpcStream doesn’t impl Serialize.
impl<T: Serialize + Unpin + Send + 'static, E: Display> ServerEncoding for Result<RpcStream<T>, E>
Streaming response encoding for RpcStream results. This impl doesn’t conflict with the above because RpcStream doesn’t impl Serialize.
fn into_dispatch(self) -> DispatchResult
Source§impl<T: Serialize, E: Display> ServerEncoding for Result<T, E>
Unary response encoding for any serializable Result type.
impl<T: Serialize, E: Display> ServerEncoding for Result<T, E>
Unary response encoding for any serializable Result type.