MessageApi

Trait MessageApi 

Source
pub trait MessageApi:
    Send
    + Sync
    + 'static {
    type SubscribeStream: Stream<Item = Result<Envelope, Status>> + Send + 'static;
    type Subscribe2Stream: Stream<Item = Result<Envelope, Status>> + Send + 'static;
    type SubscribeAllStream: Stream<Item = Result<Envelope, Status>> + Send + 'static;

    // Required methods
    fn publish<'life0, 'async_trait>(
        &'life0 self,
        request: Request<PublishRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<PublishResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe<'life0, 'async_trait>(
        &'life0 self,
        request: Request<SubscribeRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SubscribeStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe2<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Streaming<SubscribeRequest>>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::Subscribe2Stream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_all<'life0, 'async_trait>(
        &'life0 self,
        request: Request<SubscribeAllRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SubscribeAllStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn query<'life0, 'async_trait>(
        &'life0 self,
        request: Request<QueryRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<QueryResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn batch_query<'life0, 'async_trait>(
        &'life0 self,
        request: Request<BatchQueryRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<BatchQueryResponse>, 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 MessageApiServer.

Required Associated Types§

Source

type SubscribeStream: Stream<Item = Result<Envelope, Status>> + Send + 'static

Server streaming response type for the Subscribe method.

Source

type Subscribe2Stream: Stream<Item = Result<Envelope, Status>> + Send + 'static

Server streaming response type for the Subscribe2 method.

Source

type SubscribeAllStream: Stream<Item = Result<Envelope, Status>> + Send + 'static

Server streaming response type for the SubscribeAll method.

Required Methods§

Source

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

Publish messages to the network

Source

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

Subscribe to a stream of new envelopes matching a predicate

Source

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

Subscribe to a stream of new envelopes and your subscription using bidirectional streaming protolint:disable:next RPC_REQUEST_STANDARD_NAME

Source

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

Subscribe to a stream of all messages

Source

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

Query the store for messages

Source

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

BatchQuery containing a set of queries to be processed

Implementors§