pub trait CommandService:
    Send
    + Sync
    + 'static {
    type OpenStreamStream: Stream<Item = Result<CommandProviderInbound, Status>> + Send + 'static;

    // Required methods
    fn open_stream<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Streaming<CommandProviderOutbound>>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::OpenStreamStream>, Status>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn dispatch<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Command>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<CommandResponse>, Status>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

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

Required Associated Types§

Source

type OpenStreamStream: Stream<Item = Result<CommandProviderInbound, Status>> + Send + 'static

Server streaming response type for the OpenStream method.

Required Methods§

Source

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

Opens a stream allowing clients to register command handlers and receive commands.

Source

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

Dispatches the given command, returning the result of command execution

Implementors§