Extractor

Trait Extractor 

Source
pub trait Extractor {
    type Output: Tuple;
    type Error: Into<Error>;
    type Extract: TryFuture<Ok = Self::Output, Error = Self::Error>;

    // Required method
    fn extract(&self) -> Self::Extract;
}
Expand description

A trait abstracting the extraction of values from the incoming request.

Required Associated Types§

Source

type Output: Tuple

The type of output value extracted by Extract.

Source

type Error: Into<Error>

The error type that may be returned from Extract.

Source

type Extract: TryFuture<Ok = Self::Output, Error = Self::Error>

The type representing an asynchronous task to extract the value.

Required Methods§

Source

fn extract(&self) -> Self::Extract

Creates an instance of Extract.

Note that the actual extraction process is started when the value of Extract is polled.

Implementations on Foreign Types§

Source§

impl Extractor for ()

Source§

type Output = ()

Source§

type Error = Never

Source§

type Extract = Unit

Source§

fn extract(&self) -> Self::Extract

Source§

impl<E> Extractor for Box<E>
where E: Extractor,

Source§

impl<E> Extractor for Rc<E>
where E: Extractor,

Source§

impl<E> Extractor for Arc<E>
where E: Extractor,

Implementors§

Source§

impl<E, F> Extractor for Map<E, F>
where E: Extractor, E::Error: 'static, F: Func<E::Output> + Clone + Send + 'static, F::Out: 'static,

Source§

type Output = (<F as Func<<E as Extractor>::Output>>::Out,)

Source§

type Error = <E as Extractor>::Error

Source§

type Extract = MapFuture<<E as Extractor>::Extract, F>

Source§

impl<E, F, U> Extractor for MapErr<E, F>
where E: Extractor, E::Error: 'static, F: Fn(E::Error) -> U + Clone + Send + 'static, U: Into<Error>,

Source§

type Output = <E as Extractor>::Output

Source§

type Error = U

Source§

type Extract = MapErrFuture<<E as Extractor>::Extract, F>

Source§

impl<E, T> Extractor for Fallible<E, T>
where E: Extractor<Output = (T,)>,

Source§

type Output = (Result<T, <E as Extractor>::Error>,)

Source§

type Error = Never

Source§

type Extract = FallibleFuture<<E as Extractor>::Extract>

Source§

impl<E, T> Extractor for Optional<E, T>
where E: Extractor<Output = (T,)>,

Source§

type Output = (Option<T>,)

Source§

type Error = Never

Source§

type Extract = OptionalFuture<<E as Extractor>::Extract>

Source§

impl<L, R> Extractor for Chain<L, R>
where L: Extractor, R: Extractor, L::Output: Combine<R::Output>,

Source§

type Output = <<L as Extractor>::Output as Combine<<R as Extractor>::Output>>::Out

Source§

type Error = Error

Source§

type Extract = ChainFuture<<L as Extractor>::Extract, <R as Extractor>::Extract>

Source§

impl<L, R, T: Tuple> Extractor for Or<L, R>
where L: Extractor<Output = T>, R: Extractor<Output = T>,

Source§

type Output = T

Source§

type Error = Error

Source§

type Extract = OrFuture<<L as Extractor>::Extract, <R as Extractor>::Extract>