Struct Filter

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

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

Returns a new Filter service wrapping inner.

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

Returns a new Layer that wraps services with a Filter service with the given Predicate.

fn check<R>(self: &mut Self, request: R) -> Result<<U as >::Request, BoxError>
where
    U: Predicate<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 Filter<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 Filter<T, U>

fn type_id(self: &Self) -> TypeId

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

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

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

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

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

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

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

fn from(t: T) -> T

Returns the argument unchanged.

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

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

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

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

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

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

impl<T, U> Into for Filter<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 Filter<T, U>

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

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

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

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

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

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

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

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

impl<T, U, Request> Service for Filter<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 Filter<T, U>

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

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

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