Struct Filter
pub struct Filter<T, U> { /* private fields */ }
Conditionally dispatch requests to the inner service based on a predicate.
Implementations
impl<T, U> Filter<T, U>
const fn new(inner: T, predicate: U) -> SelfReturns a new
Filterservice wrappinginner.fn layer(predicate: U) -> FilterLayer<U>Returns a new
Layerthat wraps services with aFilterservice with the givenPredicate.fn check<R>(&mut self, request: R) -> Result<U::Request, BoxError> where U: Predicate<R>,Check a
Requestvalue against this filter's predicate.fn get_ref(&self) -> &TGet a reference to the inner service
fn get_mut(&mut self) -> &mut TGet a mutable reference to the inner service
fn into_inner(self) -> TConsume
self, returning the inner service
Trait Implementations
impl<T, U, Request> Service<Request> for Filter<T, U>
where
U: Predicate<Request>,
T: Service<U::Request>,
T::Error: Into<BoxError>,
type Response = <T as Service<<U as Predicate<Request>>::Request>>::Response;type Error = Box<dyn Error + Sync + Send>;type Future = ResponseFuture<<T as Service<<U as Predicate<Request>>::Request>>::Response, <T as Service<<U as Predicate<Request>>::Request>>::Future>;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>fn call(&mut self, request: Request) -> Self::Future
impl<T: Clone, U: Clone> Clone for Filter<T, U>
fn clone(&self) -> Self
impl<T: Debug, U: Debug> Debug for Filter<T, U>
fn fmt(&self, f: &mut Formatter<'_>) -> Result