1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
pub use middleware::Middleware;
pub use middleware::MiddlewareFor;
pub use middleware::MiddlewareLayer;
pub use request_interceptor::InterceptorFor;
pub use request_interceptor::RequestInterceptor;
pub use request_interceptor::RequestInterceptorLayer;

use tonic::body::BoxBody;
use tonic::codegen::http::{Request, Response};
use tonic::codegen::Service;
use tonic::transport::Body;

mod middleware;
mod request_interceptor;

pub trait ServiceBound:
    Service<Request<Body>, Response = Response<BoxBody>> + Send + Clone + 'static
{
}

impl<T> ServiceBound for T where
    T: Service<Request<Body>, Response = Response<BoxBody>> + Send + Clone + 'static
{
}