Struct rweb::filters::BoxedFilter[][src]

pub struct BoxedFilter<T> where
    T: Tuple, 
{ /* fields omitted */ }
Expand description

A type representing a boxed Filter trait object.

The filter inside is a dynamic trait object. The purpose of this type is to ease returning Filters from other functions.

To create one, call Filter::boxed on any filter.

Examples

use warp::{Filter, filters::BoxedFilter, Reply};

pub fn assets_filter() -> BoxedFilter<(impl Reply,)> {
    warp::path("assets")
        .and(warp::fs::dir("./assets"))
        .boxed()
}

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Composes a new Filter that requires both this and the other to filter a request. Read more

Composes a new Filter of either this or the other filter. Read more

Composes this Filter with a function receiving the extracted value. Read more

Composes this Filter with a function receiving the extracted value. Read more

Compose this Filter with a function receiving an error. Read more

Compose this Filter with a function receiving an error and returning a new type, instead of the same type. Read more

Unifies the extracted value of Filters composed with or. Read more

Convenience method to remove one layer of tupling. Read more

Wraps the current filter with some wrapper. Read more

Boxes this filter into a trait object, making it easier to name the type. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more