Trait Extractor

Source
pub trait Extractor {
    type Extracted: Clone + Send + Sync;
    type Error;

    // Required method
    fn extract(
        &self,
        headers: &HeaderMap,
    ) -> impl Future<Output = Result<Self::Extracted, Self::Error>> + Send;

    // Provided method
    fn extracted_type_name(&self) -> &'static str { ... }
}

Required Associated Types§

Required Methods§

Source

fn extract( &self, headers: &HeaderMap, ) -> impl Future<Output = Result<Self::Extracted, Self::Error>> + Send

Provided Methods§

Source

fn extracted_type_name(&self) -> &'static str

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<Ba> Extractor for DefaultBasicAuthAuthorizer<Ba>

Source§

impl<Be, P, C> Extractor for DefaultJwtAuthorizer<Be, P, C>
where Be: BearerExtractor + Send + Sync, P: JwkSetProvider + Send + Sync, C: DeserializeOwned + Clone + Send + Sync + 'static,

Source§

impl<Ex> Extractor for Optional<Ex>
where Ex: Extractor + Sync,

Source§

impl<Ex, C> Extractor for ChainExtractor<Ex, C>
where Ex: Extractor + Send + Sync, C: Chainer<Ex::Extracted> + Send + Sync,

Source§

impl<Ex, Fn, E> Extractor for MapError<Ex, Fn>
where Ex: Extractor + Sync, Fn: FnOnce(Ex::Error) -> E + Clone + Sync,

Source§

impl<Ex, Fn, T> Extractor for Map<Ex, Fn>
where Ex: Extractor + Sync, Fn: FnOnce(Ex::Extracted) -> T + Clone + Sync, T: Clone + Send + Sync,

Source§

impl<Ex, Fn, T, E> Extractor for ChainLite<Ex, Fn>
where Ex: Extractor + Sync, Fn: FnOnce(Ex::Extracted) -> Result<T, E> + Clone + Sync, T: Clone + Send + Sync + 'static, E: From<Ex::Error>,

Source§

impl<Ex, Fn, T, E> Extractor for Convert<Ex, Fn>
where Ex: Extractor + Sync, Fn: FnOnce(Result<Ex::Extracted, Ex::Error>) -> Result<T, E> + Clone + Sync, T: Clone + Send + Sync,

Source§

impl<Ex, Fn, T, E, Fut> Extractor for AsyncChainLite<Ex, Fn>
where Ex: Extractor + Sync, Fn: FnOnce(Ex::Extracted) -> Fut + Clone + Sync, Fut: Future<Output = Result<T, E>> + Send, T: Clone + Send + Sync + 'static, E: From<Ex::Error>,

Source§

impl<Ex, Fn, T, E, Fut> Extractor for AsyncConvert<Ex, Fn>
where Ex: Extractor + Sync, Fn: FnOnce(Result<Ex::Extracted, Ex::Error>) -> Fut + Clone + Sync, Fut: Future<Output = Result<T, E>> + Send, T: Clone + Send + Sync,

Source§

impl<Ex, Fn, T, Fut> Extractor for AsyncMap<Ex, Fn>
where Ex: Extractor + Sync, Fn: FnOnce(Ex::Extracted) -> Fut + Clone + Sync, Fut: Future<Output = T> + Send, T: Clone + Send + Sync,

Source§

impl<H> Extractor for DefaultApiKeyAuthorizer<H>
where H: HeaderExtractor + Send + Sync,

Source§

impl<L, R> Extractor for Any<L, R>
where L: Extractor + Send + Sync, R: Extractor + Send + Sync, L::Extracted: From<R::Extracted>, L::Error: Send,