pub struct ProtobufMiddleware { /* private fields */ }
Expand description
Decorate a service by converting incoming and outgoing Protobuf messages.
Implementations§
Source§impl ProtobufMiddleware
impl ProtobufMiddleware
Sourcepub fn new(send_json: bool, receive_json: bool) -> ProtobufMiddleware
pub fn new(send_json: bool, receive_json: bool) -> ProtobufMiddleware
Create a new ProtobufMiddleware
instance with options.
Trait Implementations§
Source§impl Debug for ProtobufMiddleware
impl Debug for ProtobufMiddleware
Source§impl Default for ProtobufMiddleware
impl Default for ProtobufMiddleware
Source§impl<S, ReqBody, RespBody> Middleware<S> for ProtobufMiddlewarewhere
S: Service<Request = HttpRequest<ReqBody>, Response = HttpResponse<RespBody>>,
S::Future: Future<Item = HttpResponse<RespBody>>,
S::Error: Error,
impl<S, ReqBody, RespBody> Middleware<S> for ProtobufMiddlewarewhere
S: Service<Request = HttpRequest<ReqBody>, Response = HttpResponse<RespBody>>,
S::Future: Future<Item = HttpResponse<RespBody>>,
S::Error: Error,
Auto Trait Implementations§
impl Freeze for ProtobufMiddleware
impl RefUnwindSafe for ProtobufMiddleware
impl Send for ProtobufMiddleware
impl Sync for ProtobufMiddleware
impl Unpin for ProtobufMiddleware
impl UnwindSafe for ProtobufMiddleware
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, S, B1, B2> HttpMiddleware<S> for Twhere
T: Middleware<S, Request = Request<B1>, Response = Response<B2>>,
B1: BufStream,
B2: BufStream,
impl<T, S, B1, B2> HttpMiddleware<S> for Twhere
T: Middleware<S, Request = Request<B1>, Response = Response<B2>>,
B1: BufStream,
B2: BufStream,
Source§type RequestBody = B1
type RequestBody = B1
The HTTP request body handled by the wrapped service.
Source§type ResponseBody = B2
type ResponseBody = B2
The HTTP response body returned by the wrapped service.
Source§type Error = <T as Middleware<S>>::Error
type Error = <T as Middleware<S>>::Error
The wrapped service’s error type.
Source§type Service = <T as Middleware<S>>::Service
type Service = <T as Middleware<S>>::Service
The wrapped service.
Source§fn wrap_http(&self, inner: S) -> <T as HttpMiddleware<S>>::Service
fn wrap_http(&self, inner: S) -> <T as HttpMiddleware<S>>::Service
Wrap the given service with the middleware, returning a new servicee
that has been decorated with the middleware.