Struct salvo::prelude::Compression
source · pub struct Compression { /* private fields */ }
Available on crate feature
compression
only.Expand description
Compression
Implementations§
source§impl Compression
impl Compression
sourcepub fn new() -> Compression
pub fn new() -> Compression
Create a new Compression
.
sourcepub fn with_algos(self, algos: &[CompressionAlgo]) -> Compression
pub fn with_algos(self, algos: &[CompressionAlgo]) -> Compression
Sets Compression
with algos.
sourcepub fn min_length(&mut self) -> usize
pub fn min_length(&mut self) -> usize
get min_length.
sourcepub fn set_min_length(&mut self, size: usize)
pub fn set_min_length(&mut self, size: usize)
Sets minimum compression size, if body less than this value, no compression default is 1kb
sourcepub fn with_min_length(self, min_length: usize) -> Compression
pub fn with_min_length(self, min_length: usize) -> Compression
Sets Compression
with min_length.
sourcepub fn with_force_priority(self, force_priority: bool) -> Compression
pub fn with_force_priority(self, force_priority: bool) -> Compression
Sets Compression
with force_priority.
sourcepub fn content_types_mut(&mut self) -> &mut Vec<String, Global> ⓘ
pub fn content_types_mut(&mut self) -> &mut Vec<String, Global> ⓘ
Get content type list mutable reference.
sourcepub fn with_content_types(self, content_types: &[String]) -> Compression
pub fn with_content_types(self, content_types: &[String]) -> Compression
Sets Compression
with content types list.
Trait Implementations§
source§impl Clone for Compression
impl Clone for Compression
source§fn clone(&self) -> Compression
fn clone(&self) -> Compression
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Compression
impl Debug for Compression
source§impl Default for Compression
impl Default for Compression
source§fn default() -> Compression
fn default() -> Compression
Returns the “default value” for a type. Read more
source§impl Handler for Compression
impl Handler for Compression
source§fn handle<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
req: &'life1 mut Request,
depot: &'life2 mut Depot,
res: &'life3 mut Response,
ctrl: &'life4 mut FlowCtrl
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Compression: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
req: &'life1 mut Request,
depot: &'life2 mut Depot,
res: &'life3 mut Response,
ctrl: &'life4 mut FlowCtrl
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Compression: 'async_trait,
Handle http request.
Auto Trait Implementations§
impl RefUnwindSafe for Compression
impl Send for Compression
impl Sync for Compression
impl Unpin for Compression
impl UnwindSafe for Compression
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<Key, T> QuotaGetter<Key> for Twhere
Key: 'static + Hash + Eq + Send + Sync,
T: 'static + Clone + Send + Sync,
impl<Key, T> QuotaGetter<Key> for Twhere
Key: 'static + Hash + Eq + Send + Sync,
T: 'static + Clone + Send + Sync,
§type Error = Infallible
type Error = Infallible
Error type.
source§fn get<'life0, 'life1, 'async_trait, Q>(
&'life0 self,
_key: &'life1 Q
) -> Pin<Box<dyn Future<Output = Result<<T as QuotaGetter<Key>>::Quota, <T as QuotaGetter<Key>>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: Borrow<Q>,
Q: Hash + Eq + Sync + 'async_trait,
T: 'async_trait,
fn get<'life0, 'life1, 'async_trait, Q>(
&'life0 self,
_key: &'life1 Q
) -> Pin<Box<dyn Future<Output = Result<<T as QuotaGetter<Key>>::Quota, <T as QuotaGetter<Key>>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: Borrow<Q>,
Q: Hash + Eq + Sync + 'async_trait,
T: 'async_trait,
Get quota.