Struct rocket_async_compression::Compress
source · [−]pub struct Compress<R>(pub R);Expand description
Compresses responses with Brotli or Gzip compression using the async-compression crate.
The Compress type implements brotli and gzip compression for responses in
accordance with the Accept-Encoding header. If accepted, brotli
compression is preferred over gzip.
Responses that already have a Content-Encoding header are not compressed.
Usage
Compress responses by wrapping a Responder inside Compress:
use rocket_async_compression::Compress;
let response = Compress("Hi.");Tuple Fields
0: RTrait Implementations
Auto Trait Implementations
impl<R> RefUnwindSafe for Compress<R>where
R: RefUnwindSafe,
impl<R> Send for Compress<R>where
R: Send,
impl<R> Sync for Compress<R>where
R: Sync,
impl<R> Unpin for Compress<R>where
R: Unpin,
impl<R> UnwindSafe for Compress<R>where
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
Converts
self into a collection.