Trait tower::filter::Predicate

source ·
pub trait Predicate<Request> {
    type Request;

    // Required method
    fn check(&mut self, request: Request) -> Result<Self::Request, BoxError>;
}
Expand description

Checks a request synchronously.

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

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, R, E> Predicate<T> for F
where F: FnMut(T) -> Result<R, E>, E: Into<BoxError>,

§

type Request = R