tonic::server

Trait UnaryService

Source
pub trait UnaryService<R> {
    type Response;
    type Future: Future<Output = Result<Response<Self::Response>, 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 UnaryService.

Required Associated Types§

Source

type Response

Protobuf response message type

Source

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

Response future

Required Methods§

Source

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

Call the service

Implementors§

Source§

impl<T, M1, M2> UnaryService<M1> for T
where T: Service<Request<M1>, Response = Response<M2>, Error = Status>,