Struct AsyncFilter
pub struct AsyncFilter<T, U> { /* private fields */ }
Conditionally dispatch requests to the inner service based on an asynchronous predicate.
Implementations
impl<T, U> AsyncFilter<T, U>
const fn new(inner: T, predicate: U) -> SelfReturns a new
AsyncFilterservice wrappinginner.fn layer(predicate: U) -> FilterLayer<U>Returns a new
Layerthat wraps services with anAsyncFilterservice with the givenAsyncPredicate.async fn check<R>(&mut self, request: R) -> Result<U::Request, BoxError> where U: AsyncPredicate<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 AsyncFilter<T, U>
where
U: AsyncPredicate<Request>,
T: Service<U::Request> + Clone,
T::Error: Into<BoxError>,
type Response = <T as Service<<U as AsyncPredicate<Request>>::Request>>::Response;type Error = Box<dyn Error + Sync + Send>;type Future = AsyncResponseFuture<U, T, Request>;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 AsyncFilter<T, U>
fn clone(&self) -> Self
impl<T: Debug, U: Debug> Debug for AsyncFilter<T, U>
fn fmt(&self, f: &mut Formatter<'_>) -> Result