Trait tower::filter::AsyncPredicate[][src]

pub trait AsyncPredicate<Request> {
    type Future: Future<Output = Result<Self::Request, BoxError>>;
    type Request;
    fn check(&mut self, request: Request) -> Self::Future;
This is supported on crate feature filter only.

Checks a request asynchronously.

Associated Types

type Future: Future<Output = Result<Self::Request, BoxError>>[src]

The future returned by check.

type Request[src]

The type of requests returned by check.

This request is forwarded to the inner service if the predicate succeeds.

Loading content...

Required methods

fn check(&mut self, request: Request) -> Self::Future[src]

Check whether the given request should be forwarded.

If the future resolves with Ok, the request is forwarded to the inner service.

Loading content...


impl<F, T, U, R, E> AsyncPredicate<T> for F where
    F: FnMut(T) -> U,
    U: Future<Output = Result<R, E>>,
    E: Into<BoxError>, 

type Future = ErrInto<U, BoxError>

type Request = R

Loading content...