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 Filter
s 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
Auto Trait Implementations
impl<T> !RefUnwindSafe for BoxedFilter<T>
impl<T> Send for BoxedFilter<T>
impl<T> Sync for BoxedFilter<T>
impl<T> Unpin for BoxedFilter<T>
impl<T> !UnwindSafe for BoxedFilter<T>
Blanket Implementations
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
fn or_else<F>(self, fun: F) -> OrElse<Self, F> where
Self: Filter<Error = Rejection>,
F: Func<Rejection>,
<F as Func<Rejection>>::Output: TryFuture,
<F as Func<Rejection>>::Output: Send,
<<F as Func<Rejection>>::Output as TryFuture>::Error: IsReject,
<<F as Func<Rejection>>::Output as TryFuture>::Ok == Self::Extract,
fn or_else<F>(self, fun: F) -> OrElse<Self, F> where
Self: Filter<Error = Rejection>,
F: Func<Rejection>,
<F as Func<Rejection>>::Output: TryFuture,
<F as Func<Rejection>>::Output: Send,
<<F as Func<Rejection>>::Output as TryFuture>::Error: IsReject,
<<F as Func<Rejection>>::Output as TryFuture>::Ok == Self::Extract,
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 Filter
s composed with or
. Read more
Convenience method to remove one layer of tupling. Read more
Wraps the current filter with some wrapper. Read more
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
pub fn vzip(self) -> V
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more