pub struct CompressionMiddleware;Expand description
The middleware that marks the answer with the encoding the client asked for.
Trait Implementations§
Source§impl Clone for CompressionMiddleware
impl Clone for CompressionMiddleware
impl Copy for CompressionMiddleware
Source§impl Debug for CompressionMiddleware
impl Debug for CompressionMiddleware
Source§impl Default for CompressionMiddleware
impl Default for CompressionMiddleware
Source§impl ServerHook for CompressionMiddleware
impl ServerHook for CompressionMiddleware
Source§async fn handle(self, _: &mut Stream, ctx: &mut Context) -> Status
async fn handle(self, _: &mut Stream, ctx: &mut Context) -> Status
Marks the answer with the encoding the client asked for.
The body is compressed when the answer is built, so the middleware only writes the header that names the encoding.
§Arguments
Self- The middleware.&mut Stream- The stream the request arrived on.&mut Context- The context of the request.
§Returns
Status- Whether the pipeline continues.
Auto Trait Implementations§
impl Freeze for CompressionMiddleware
impl RefUnwindSafe for CompressionMiddleware
impl Send for CompressionMiddleware
impl Sync for CompressionMiddleware
impl Unpin for CompressionMiddleware
impl UnsafeUnpin for CompressionMiddleware
impl UnwindSafe for CompressionMiddleware
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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