Trait Extractor

Source
pub trait Extractor<'a, R> {
    type Error: ExtractorError;
    type Prepared;

    // Required methods
    fn validate(validate: Validate<'_>);
    fn prepare(
        prepare: Prepare<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Prepared, Self::Error>> + Send + '_>>;
    fn extract(
        extract: Extract<'a, '_, Self::Prepared, R>,
    ) -> Result<Self, Self::Error>
       where Self: Sized;
}

Required Associated Types§

Required Methods§

Source

fn validate(validate: Validate<'_>)

Source

fn prepare( prepare: Prepare<'_>, ) -> Pin<Box<dyn Future<Output = Result<Self::Prepared, Self::Error>> + Send + '_>>

Source

fn extract( extract: Extract<'a, '_, Self::Prepared, R>, ) -> Result<Self, Self::Error>
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a> Extractor<'a, &'a mut Request> for &'a mut Request

Source§

impl<'a> Extractor<'a, WebSocket> for WebSocket

Available on crate feature ws only.
Source§

impl<'a, R> Extractor<'a, R> for &'a RequestHeader

Source§

impl<'a, R> Extractor<'a, R> for &'a PathParam<str>

Source§

impl<'a, R: 'a> Extractor<'a, R> for &'a Resources

Source§

impl<'a, T, R> Extractor<'a, R> for PathParam<T>
where T: Send + Sync + FromStr + 'a, T::Err: StdError + Send + Sync + 'static,

Source§

impl<'a, T, R> Extractor<'a, R> for Res<'a, T>
where T: Send + Sync + 'static,