pub trait Broker: Send + Sync + 'static {
    type OpenTelemetryStreamStream: Stream<Item = Result<TelemetryStreamResponse, Status>> + Send + 'static;
    type OpenCommandStreamStream: Stream<Item = Result<CommandStreamResponse, Status>> + Send + 'static;

    // Required methods
    fn post_command<'life0, 'async_trait>(
        &'life0 self,
        request: Request<PostCommandRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<PostCommandResponse>, Status>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn open_telemetry_stream<'life0, 'async_trait>(
        &'life0 self,
        request: Request<TelemetryStreamRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::OpenTelemetryStreamStream>, Status>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn get_last_received_telemetry<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GetLastReceivedTelemetryRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<GetLastReceivedTelemetryResponse>, Status>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn open_command_stream<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Streaming<CommandStreamRequest>>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::OpenCommandStreamStream>, Status>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn post_telemetry<'life0, 'async_trait>(
        &'life0 self,
        request: Request<PostTelemetryRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<PostTelemetryResponse>, 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 BrokerServer.

Required Associated Types§

type OpenTelemetryStreamStream: Stream<Item = Result<TelemetryStreamResponse, Status>> + Send + 'static

Server streaming response type for the OpenTelemetryStream method.

type OpenCommandStreamStream: Stream<Item = Result<CommandStreamResponse, Status>> + Send + 'static

Server streaming response type for the OpenCommandStream method.

Required Methods§

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

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

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

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

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

Implementors§

source§

impl<C> Broker for BrokerService<C>
where C: Handle<Arc<Tco>> + Send + Sync + 'static, C::Response: Send + 'static,