Struct choices::warp::filters::BoxedFilter[][src]

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

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

impl<T> Clone for BoxedFilter<T> where
    T: Tuple, 
[src]

pub fn clone(&self) -> BoxedFilter<T>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T> Debug for BoxedFilter<T> where
    T: Tuple, 
[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

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

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T

Notable traits for &'_ mut F

impl<'_, F> Future for &'_ mut F where
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;
[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T

Notable traits for &'_ mut F

impl<'_, F> Future for &'_ mut F where
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;
[src]

Mutably borrows from an owned value. Read more

impl<T> Filter for T where
    T: FilterBase, 
[src]

fn and<F>(self, other: F) -> And<Self, F> where
    F: Filter + Clone,
    <Self::Extract as Tuple>::HList: Combine<<<F as FilterBase>::Extract as Tuple>::HList>,
    <F as FilterBase>::Error: CombineRejection<Self::Error>, 
[src]

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

fn or<F>(self, other: F) -> Or<Self, F> where
    Self: Filter<Error = Rejection>,
    F: Filter,
    <F as FilterBase>::Error: CombineRejection<Self::Error>, 
[src]

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

fn map<F>(self, fun: F) -> Map<Self, F> where
    F: Func<Self::Extract> + Clone
[src]

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

fn and_then<F>(self, fun: F) -> AndThen<Self, F> where
    F: Func<Self::Extract> + Clone,
    <F as Func<Self::Extract>>::Output: TryFuture,
    <F as Func<Self::Extract>>::Output: Send,
    <<F as Func<Self::Extract>>::Output as TryFuture>::Error: CombineRejection<Self::Error>, 
[src]

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, 
[src]

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

fn recover<F>(self, fun: F) -> Recover<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, 
[src]

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

fn unify<T>(self) -> Unify<Self> where
    Self: Filter<Extract = (Either<T, T>,)>,
    T: Tuple, 
[src]

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

fn untuple_one<T>(self) -> UntupleOne<Self> where
    Self: Filter<Extract = (T,)>,
    T: Tuple, 
[src]

Convenience method to remove one layer of tupling. Read more

fn with<W>(self, wrapper: W) -> <W as WrapSealed<Self>>::Wrapped where
    W: Wrap<Self>, 
[src]

Wraps the current filter with some wrapper. Read more

fn boxed(self) -> BoxedFilter<Self::Extract> where
    Self: Send + Sync + 'static,
    Self::Extract: Send,
    Self::Error: Into<Rejection>, 
[src]

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

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

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;
[src]

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

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;
[src]

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

impl<T> Instrument for T[src]

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;
[src]

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

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;
[src]

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

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

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

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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

pub fn vzip(self) -> V