Trait warp::filter::FilterBase

source ·
pub trait FilterBase {
    type Extract: Tuple;
    type Error: IsReject;
    type Future: Future<Output = Result<Self::Extract, Self::Error>> + Send;

    // Required method
    fn filter(&self, internal: Internal) -> Self::Future;

    // Provided method
    fn map_err<F, E>(self, _internal: Internal, fun: F) -> MapErr<Self, F>
       where Self: Sized,
             F: Fn(Self::Error) -> E + Clone,
             E: Debug + Send { ... }
}

Required Associated Types§

Required Methods§

source

fn filter(&self, internal: Internal) -> Self::Future

Provided Methods§

source

fn map_err<F, E>(self, _internal: Internal, fun: F) -> MapErr<Self, F>
where Self: Sized, F: Fn(Self::Error) -> E + Clone, E: Debug + Send,

Implementors§

source§

impl FilterBase for Any

source§

impl<F> FilterBase for CorsFilter<F>

source§

impl<F> FilterBase for BoxingFilter<F>
where F: Filter, F::Future: Send + 'static,

§

type Extract = <F as FilterBase>::Extract

§

type Error = <F as FilterBase>::Error

§

type Future = Pin<Box<dyn Future<Output = Result<<BoxingFilter<F> as FilterBase>::Extract, <BoxingFilter<F> as FilterBase>::Error>> + Send>>

source§

impl<F, T> FilterBase for Unify<F>
where F: Filter<Extract = (Either<T, T>,)>, T: Tuple,

§

type Extract = T

§

type Error = <F as FilterBase>::Error

§

type Future = UnifyFuture<<F as FilterBase>::Future>

source§

impl<F, T> FilterBase for UntupleOne<F>
where F: Filter<Extract = (T,)>, T: Tuple,

§

type Extract = T

§

type Error = <F as FilterBase>::Error

§

type Future = UntupleOneFuture<F>

source§

impl<F, U> FilterBase for FilterFn<F>
where F: Fn(&mut Route) -> U, U: TryFuture + Send + 'static, U::Ok: Tuple + Send, U::Error: IsReject,

§

type Extract = <U as TryFuture>::Ok

§

type Error = <U as TryFuture>::Error

§

type Future = IntoFuture<U>

source§

impl<FN, F> FilterBase for WithLog<FN, F>
where FN: Fn(Info<'_>) + Clone + Send, F: Filter + Clone + Send, F::Extract: Reply, F::Error: IsReject,

§

type Extract = (Logged,)

§

type Error = <F as FilterBase>::Error

§

type Future = WithLogFuture<FN, <F as FilterBase>::Future>

source§

impl<FN, F> FilterBase for WithTrace<FN, F>
where FN: Fn(Info<'_>) -> Span + Clone + Send, F: Filter + Clone + Send, F::Extract: Reply, F::Error: IsReject,

§

type Extract = (Traced,)

§

type Error = <F as FilterBase>::Error

§

type Future = Instrumented<Inspect<MapOk<<F as FilterBase>::Future, fn(_: <F as FilterBase>::Extract) -> <WithTrace<FN, F> as FilterBase>::Extract>, fn(_: &Result<<WithTrace<FN, F> as FilterBase>::Extract, <F as FilterBase>::Error>)>>

source§

impl<P> FilterBase for Exact<P>
where P: AsRef<str>,

source§

impl<T, F> FilterBase for AndThen<T, F>

§

type Extract = (<<F as Func<<T as FilterBase>::Extract>>::Output as TryFuture>::Ok,)

§

type Error = <<<F as Func<<T as FilterBase>::Extract>>::Output as TryFuture>::Error as CombineRejection<<T as FilterBase>::Error>>::One

§

type Future = AndThenFuture<T, F>

source§

impl<T, F> FilterBase for Map<T, F>
where T: Filter, F: Func<T::Extract> + Clone + Send,

§

type Extract = (<F as Func<<T as FilterBase>::Extract>>::Output,)

§

type Error = <T as FilterBase>::Error

§

type Future = MapFuture<T, F>

source§

impl<T, F> FilterBase for OrElse<T, F>
where T: Filter, F: Func<T::Error> + Clone + Send, F::Output: TryFuture<Ok = T::Extract> + Send, <F::Output as TryFuture>::Error: IsReject,

§

type Extract = <<F as Func<<T as FilterBase>::Error>>::Output as TryFuture>::Ok

§

type Error = <<F as Func<<T as FilterBase>::Error>>::Output as TryFuture>::Error

§

type Future = OrElseFuture<T, F>

source§

impl<T, F> FilterBase for Recover<T, F>
where T: Filter, F: Func<T::Error> + Clone + Send, F::Output: TryFuture + Send, <F::Output as TryFuture>::Error: IsReject,

§

type Extract = (Either<<T as FilterBase>::Extract, (<<F as Func<<T as FilterBase>::Error>>::Output as TryFuture>::Ok,)>,)

§

type Error = <<F as Func<<T as FilterBase>::Error>>::Output as TryFuture>::Error

§

type Future = RecoverFuture<T, F>

source§

impl<T, F> FilterBase for Then<T, F>
where T: Filter, F: Func<T::Extract> + Clone + Send, F::Output: Future + Send,

§

type Extract = (<<F as Func<<T as FilterBase>::Extract>>::Output as Future>::Output,)

§

type Error = <T as FilterBase>::Error

§

type Future = ThenFuture<T, F>

source§

impl<T, F, E> FilterBase for MapErr<T, F>
where T: Filter, F: Fn(T::Error) -> E + Clone + Send, E: IsReject,

§

type Extract = <T as FilterBase>::Extract

§

type Error = E

§

type Future = MapErrFuture<T, F>

source§

impl<T, U> FilterBase for And<T, U>
where T: Filter, T::Extract: Send, U: Filter + Clone + Send, <T::Extract as Tuple>::HList: Combine<<U::Extract as Tuple>::HList> + Send, <<<T::Extract as Tuple>::HList as Combine<<U::Extract as Tuple>::HList>>::Output as HList>::Tuple: Send, U::Error: CombineRejection<T::Error>,

§

type Extract = <<<<T as FilterBase>::Extract as Tuple>::HList as Combine<<<U as FilterBase>::Extract as Tuple>::HList>>::Output as HList>::Tuple

§

type Error = <<U as FilterBase>::Error as CombineRejection<<T as FilterBase>::Error>>::One

§

type Future = AndFuture<T, U>

source§

impl<T, U> FilterBase for Or<T, U>
where T: Filter, U: Filter + Clone + Send, U::Error: CombineRejection<T::Error>,

source§

impl<T: Tuple + Send> FilterBase for BoxedFilter<T>

§

type Extract = T

§

type Error = Rejection

§

type Future = Pin<Box<dyn Future<Output = Result<T, Rejection>> + Send>>