Skip to main content

ServiceCall

Trait ServiceCall 

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

Source

type Route: RouteHeader

Source

type Params

Source

type Reply

Source

type Throws

Application-level error type (IDL throws). Always () for v1.

Source

type Output

Required Methods§

Source

fn encode_call(route: &Self::Route, value: &Self::Params) -> Vec<u8>

Source

fn decode_reply( route: &Self::Route, payload: impl AsRef<[u8]>, ) -> Result<Self::Output, Error>

Source

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".

Implementors§