tonic::server

Trait ServerStreamingService

Source
pub trait ServerStreamingService<R> {
    type Response;
    type ResponseStream: Stream<Item = Result<Self::Response, Status>>;
    type Future: Future<Output = Result<Response<Self::ResponseStream>, Status>>;

    // Required method
    fn call(&mut self, request: Request<R>) -> Self::Future;
}
Expand description

A specialization of tower_service::Service.

Existing tower_service::Service implementations with the correct form will automatically implement ServerStreamingService.

Required Associated Types§

Source

type Response

Protobuf response message type

Source

type ResponseStream: Stream<Item = Result<Self::Response, Status>>

Stream of outbound response messages

Source

type Future: Future<Output = Result<Response<Self::ResponseStream>, Status>>

Response future

Required Methods§

Source

fn call(&mut self, request: Request<R>) -> Self::Future

Call the service

Implementors§

Source§

impl<T, S, M1, M2> ServerStreamingService<M1> for T
where T: Service<Request<M1>, Response = Response<S>, Error = Status>, S: Stream<Item = Result<M2, Status>>,