MakeHeaderValueFactoryFn

Trait MakeHeaderValueFactoryFn 

pub trait MakeHeaderValueFactoryFn<ReqBody, ResBody, A>:
    Send
    + Sync
    + 'static {
    type Maker: MakeHeaderValue<ResBody>;

    // Required method
    fn call(
        &self,
        request: Request<ReqBody>,
    ) -> impl Future<Output = (Request<ReqBody>, Self::Maker)> + Send;
}
Expand description

Functional version of MakeHeaderValue.

Required Associated Types§

type Maker: MakeHeaderValue<ResBody>

Required Methods§

fn call( &self, request: Request<ReqBody>, ) -> impl Future<Output = (Request<ReqBody>, Self::Maker)> + Send

Try to create a header value from the request or response.

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§

§

impl<F, Fut, ReqBody, ResBody> MakeHeaderValueFactoryFn<ReqBody, ResBody, ((), (), ())> for F
where ReqBody: Send + 'static, ResBody: Send + 'static, F: Fn() -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Option<HeaderValue>> + Send + 'static,

§

impl<F, Fut, ReqBody, ResBody> MakeHeaderValueFactoryFn<ReqBody, ResBody, ((), (), Response<ResBody>)> for F
where ReqBody: Send + 'static, ResBody: Send + 'static, F: Fn(Response<ResBody>) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = (Response<ResBody>, Option<HeaderValue>)> + Send + 'static,

§

impl<F, Fut, ReqBody, ResBody, M> MakeHeaderValueFactoryFn<ReqBody, ResBody, ((), Request<ReqBody>)> for F
where ReqBody: Send + 'static, ResBody: Send + 'static, M: MakeHeaderValue<ResBody>, F: Fn(Request<ReqBody>) -> Fut + Send + Sync + 'static, Fut: Future<Output = (Request<ReqBody>, M)> + Send + 'static,

§

type Maker = M

§

impl<F, Fut, ReqBody, ResBody, M> MakeHeaderValueFactoryFn<ReqBody, ResBody, ()> for F
where ReqBody: Send + 'static, ResBody: Send + 'static, M: MakeHeaderValue<ResBody>, F: Fn() -> Fut + Send + Sync + 'static, Fut: Future<Output = M> + Send + 'static,

§

type Maker = M