feat(tonic): add Interceptor trait (#713)
* Expose `Interceptor` trait. * Revert changes to public API surface. * Rename types, add deprecated alias for old names.
This commit is contained in:
@@ -68,7 +68,7 @@ pub fn generate<T: Service>(
|
||||
|
||||
pub fn with_interceptor<F>(inner: T, interceptor: F) -> #service_ident<InterceptedService<T, F>>
|
||||
where
|
||||
F: FnMut(tonic::Request<()>) -> Result<tonic::Request<()>, tonic::Status>,
|
||||
F: tonic::service::Interceptor,
|
||||
T: tonic::codegen::Service<
|
||||
http::Request<tonic::body::BoxBody>,
|
||||
Response = http::Response<<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody>
|
||||
|
||||
@@ -104,7 +104,7 @@ pub fn generate<T: Service>(
|
||||
|
||||
pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
|
||||
where
|
||||
F: FnMut(tonic::Request<()>) -> Result<tonic::Request<()>, tonic::Status>,
|
||||
F: tonic::service::Interceptor,
|
||||
{
|
||||
InterceptedService::new(Self::new(inner), interceptor)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user