tonic/server/mod.rs
1//! Generic server implementation.
2//!
3//! This module contains the low level components to build a gRPC server. It
4//! provides a codec agnostic gRPC server handler.
5//!
6//! The items in this module are generally designed to be used by some codegen
7//! tool that will provide the user some custom way to implement the server that
8//! will implement the proper gRPC service. Thusly, they are a bit hard to use
9//! by hand.
10
11mod grpc;
12mod service;
13
14pub use self::grpc::Grpc;
15pub use self::service::{
16 ClientStreamingService, ServerStreamingService, StreamingService, UnaryService,
17};
18
19/// A trait to provide a static reference to the service's
20/// name. This is used for routing service's within the router.
21pub trait NamedService {
22 /// The `Service-Name` as described [here].
23 ///
24 /// [here]: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests
25 const NAME: &'static str;
26}