[][src]Struct tide_compress::CompressMiddleware

pub struct CompressMiddleware { /* fields omitted */ }

A middleware for compressing response body data.

Example

let mut app = tide::new();

app.with(tide_compress::CompressMiddleware::new());

Implementations

impl CompressMiddleware[src]

pub fn new() -> Self[src]

Creates a new CompressMiddleware.

Uses the default minimum body size threshold (1024 bytes).

Example

let mut app = tide::new();

app.with(tide_compress::CompressMiddleware::new());

pub fn with_threshold(threshold: usize) -> Self[src]

Creates a new CompressMiddleware with a custom minimum body size threshold.

Arguments

  • threshold - minimum body size in bytes.

Example

let mut app = tide::new();

app.with(tide_compress::CompressMiddleware::with_threshold(512));

Trait Implementations

impl Clone for CompressMiddleware[src]

impl Debug for CompressMiddleware[src]

impl Default for CompressMiddleware[src]

impl<State: Clone + Send + Sync + 'static> Middleware<State> for CompressMiddleware[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<State, F> Middleware<State> for F where
    F: Send + Sync + 'static + for<'a> Fn(Request<State>, Next<'a, State>) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + 'a + Send>>,
    State: Clone + Send + Sync + 'static, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,