pub trait ServiceCall {
type Route: RouteHeader;
type Params;
type Reply;
type Throws;
type Output;
// Required methods
fn encode_call(route: &Self::Route, value: &Self::Params) -> Vec<u8>;
fn decode_reply(
route: &Self::Route,
payload: impl AsRef<[u8]>,
) -> Result<Self::Output, Error>;
fn decode_error(
route: &Self::Route,
payload: impl AsRef<[u8]>,
) -> Result<Self::Output, Error>;
}Expand description
Unified service-call codec parameterized by route header.
Required Associated Types§
Required Methods§
fn encode_call(route: &Self::Route, value: &Self::Params) -> Vec<u8>
fn decode_reply( route: &Self::Route, payload: impl AsRef<[u8]>, ) -> Result<Self::Output, Error>
fn decode_error( route: &Self::Route, payload: impl AsRef<[u8]>, ) -> Result<Self::Output, Error>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".