Trait Rpc

Source
pub trait Rpc:
    Send
    + Sync
    + 'static {
    type SocketRpcStream: Stream<Item = Result<RpcResponse, Status>> + Send + 'static;

    // Required methods
    fn json_rpc<'life0, 'async_trait>(
        &'life0 self,
        request: Request<RpcRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<RpcResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn socket_rpc<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Streaming<RpcRequest>>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SocketRpcStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with RpcServer.

Required Associated Types§

Source

type SocketRpcStream: Stream<Item = Result<RpcResponse, Status>> + Send + 'static

Server streaming response type for the SocketRpc method.

Required Methods§

Source

fn json_rpc<'life0, 'async_trait>( &'life0 self, request: Request<RpcRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<RpcResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn socket_rpc<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<RpcRequest>>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SocketRpcStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§