pub trait AsyncPredicate<Request> {
    type Request;

    // Required method
    async fn check(
        &mut self,
        request: Request
    ) -> Result<Self::Request, BoxError>;
}
Available on crate feature filter only.
Expand description

Checks a request asynchronously.

Required Associated Types§

source

type Request

The type of requests returned by check.

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

Required Methods§

source

async fn check(&mut self, request: Request) -> Result<Self::Request, BoxError>

Check whether the given request should be forwarded.

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

Implementors§

source§

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

§

type Request = R