Trait tower_http::compression::Predicate
source · [−]pub trait Predicate: Clone {
fn should_compress<B>(&self, response: &Response<B>) -> bool
where
B: Body;
fn and<Other>(self, other: Other) -> And<Self, Other>
where
Self: Sized,
Other: Predicate,
{ ... }
}Available on crate features
compression-br or compression-deflate or compression-gzip only.Expand description
Predicate used to determine if a response should be compressed or not.
Required Methods
fn should_compress<B>(&self, response: &Response<B>) -> bool where
B: Body,
fn should_compress<B>(&self, response: &Response<B>) -> bool where
B: Body,
Should this response be compressed or not?
Provided Methods
Implementations on Foreign Types
sourceimpl<T> Predicate for Option<T> where
T: Predicate,
impl<T> Predicate for Option<T> where
T: Predicate,
sourcefn should_compress<B>(&self, response: &Response<B>) -> bool where
B: Body,
fn should_compress<B>(&self, response: &Response<B>) -> bool where
B: Body,
Available on crate features
compression-br or compression-deflate or compression-gzip only.