Struct AsyncFilter

struct AsyncFilter<T, U> { ... }

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) -> Self

Returns a new AsyncFilter service wrapping inner.

fn layer(predicate: U) -> FilterLayer<U>

Returns a new Layer that wraps services with an AsyncFilter service with the given AsyncPredicate.

async fn check<R>(self: &mut Self, request: R) -> Result<<U as >::Request, BoxError>
where
    U: AsyncPredicate<R>

Check a Request value against this filter's predicate.

fn get_ref(self: &Self) -> &T

Get a reference to the inner service

fn get_mut(self: &mut Self) -> &mut T

Get a mutable reference to the inner service

fn into_inner(self: Self) -> T

Consume self, returning the inner service

impl<M, S, Target, Request> MakeService for AsyncFilter<T, U>

fn poll_ready(self: &mut Self, cx: &mut Context<'_>) -> Poll<Result<(), <M as MakeService<Target, Request>>::MakeError>>
fn make_service(self: &mut Self, target: Target) -> <M as MakeService<Target, Request>>::Future

impl<T> Any for AsyncFilter<T, U>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for AsyncFilter<T, U>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for AsyncFilter<T, U>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for AsyncFilter<T, U>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for AsyncFilter<T, U>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for AsyncFilter<T, U>

impl<T> ToOwned for AsyncFilter<T, U>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> WithSubscriber for AsyncFilter<T, U>

impl<T, Request> ServiceExt for AsyncFilter<T, U>

impl<T, U> Freeze for AsyncFilter<T, U>

impl<T, U> Into for AsyncFilter<T, U>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> RefUnwindSafe for AsyncFilter<T, U>

impl<T, U> Send for AsyncFilter<T, U>

impl<T, U> Sync for AsyncFilter<T, U>

impl<T, U> TryFrom for AsyncFilter<T, U>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for AsyncFilter<T, U>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<T, U> Unpin for AsyncFilter<T, U>

impl<T, U> UnwindSafe for AsyncFilter<T, U>

impl<T, U, Request> Service for AsyncFilter<T, U>

fn poll_ready(self: &mut Self, cx: &mut Context<'_>) -> Poll<Result<(), <Self as >::Error>>
fn call(self: &mut Self, request: Request) -> <Self as >::Future

impl<T: $crate::clone::Clone, U: $crate::clone::Clone> Clone for AsyncFilter<T, U>

fn clone(self: &Self) -> AsyncFilter<T, U>

impl<T: $crate::fmt::Debug, U: $crate::fmt::Debug> Debug for AsyncFilter<T, U>

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result