Skip to main content

RpcTransport

Trait RpcTransport 

Source
pub trait RpcTransport:
    Send
    + Sync
    + 'static {
    // Required method
    fn call(
        &self,
        service_id: u16,
        method_id: u16,
        payload: Vec<u8>,
    ) -> Result<Vec<u8>, RpcError>;
}
Expand description

Trait for client-side RPC transport.

Abstracts the mechanism of sending a request and receiving a response. The main mill-rpc crate provides an implementation built on mill-net.

Required Methods§

Source

fn call( &self, service_id: u16, method_id: u16, payload: Vec<u8>, ) -> Result<Vec<u8>, RpcError>

Send a request and wait for a response. Returns the raw response payload bytes.

Implementors§