pub fn grpc_server<PC, PR, F, S>(
    listen_addr: String,
    f: F
) -> GrpcServerInterface<PC, PR> where
    PC: Send + 'static,
    PR: Send + 'static,
    S: Service<Request<Body>, Response = Response<BoxBody>, Error = Infallible> + NamedService + Clone + Send + 'static,
    S::Future: Send + 'static,
    F: FnOnce(GrpcServer<PC, PR>) -> S + Send + 'static, 
Expand description

Creates a running gRPC based server that can receive PC and sends PR. Returns a a tuple of GrpcServerInterface that can be used to recv and send from. As well as a shutdown signal, which should be used to terminate the mainloop if a message is sent.

The trait bounds here are intimidating, but the f parameter is _a function that turns a GrpcServer<ProtoCommandType, ProtoResponseType> into a tower::Service that represents a grpc server. This is always encapsulated by the ExportedFromTonicServer::new for a specific protobuf service.