Struct tower_http::compression::CompressionLayer [−][src]
pub struct CompressionLayer { /* fields omitted */ }compression only.Expand description
Compress response bodies of the underlying service.
This uses the Accept-Encoding header to pick an appropriate encoding and adds the
Content-Encoding header to responses.
See the module docs for more details.
Implementations
impl CompressionLayer[src]
impl CompressionLayer[src]pub fn new() -> Self[src]
pub fn new() -> Self[src]Create a new CompressionLayer
pub fn gzip(self, enable: bool) -> Self[src]
This is supported on crate feature compression-gzip only.
pub fn gzip(self, enable: bool) -> Self[src]compression-gzip only.Sets whether to enable the gzip encoding.
pub fn deflate(self, enable: bool) -> Self[src]
This is supported on crate feature compression-deflate only.
pub fn deflate(self, enable: bool) -> Self[src]compression-deflate only.Sets whether to enable the Deflate encoding.
pub fn br(self, enable: bool) -> Self[src]
This is supported on crate feature compression-br only.
pub fn br(self, enable: bool) -> Self[src]compression-br only.Sets whether to enable the Brotli encoding.
pub fn no_gzip(self) -> Self[src]
pub fn no_gzip(self) -> Self[src]Disables the gzip encoding.
This method is available even if the gzip crate feature is disabled.
pub fn no_deflate(self) -> Self[src]
pub fn no_deflate(self) -> Self[src]Disables the Deflate encoding.
This method is available even if the deflate crate feature is disabled.
Trait Implementations
impl Clone for CompressionLayer[src]
impl Clone for CompressionLayer[src]fn clone(&self) -> CompressionLayer[src]
fn clone(&self) -> CompressionLayer[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl Debug for CompressionLayer[src]
impl Debug for CompressionLayer[src]impl Default for CompressionLayer[src]
impl Default for CompressionLayer[src]fn default() -> CompressionLayer[src]
fn default() -> CompressionLayer[src]Returns the “default value” for a type. Read more
impl<S> Layer<S> for CompressionLayer[src]
impl<S> Layer<S> for CompressionLayer[src]Auto Trait Implementations
impl RefUnwindSafe for CompressionLayer
impl Send for CompressionLayer
impl Sync for CompressionLayer
impl Unpin for CompressionLayer
impl UnwindSafe for CompressionLayer
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]fn instrument(self, span: Span) -> Instrumented<Self>[src]
fn instrument(self, span: Span) -> Instrumented<Self>[src]Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>[src]
fn in_current_span(self) -> Instrumented<Self>[src]impl<T> PolicyExt for T where
T: ?Sized, [src]
impl<T> PolicyExt for T where
T: ?Sized, [src]impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more