MakeHeaderValueFn

Trait MakeHeaderValueFn 

pub trait MakeHeaderValueFn<B, A>:
    Send
    + Sync
    + 'static {
    // Required method
    fn call(
        &self,
        req: Request<B>,
    ) -> impl Future<Output = (Request<B>, Option<HeaderValue>)> + Send;
}
Expand description

Functional version of MakeHeaderValue.

Required Methods§

fn call( &self, req: Request<B>, ) -> impl Future<Output = (Request<B>, Option<HeaderValue>)> + 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, B> MakeHeaderValueFn<B, ((), B)> for F
where B: Send + 'static, F: Fn(Request<B>) -> Fut + Send + Sync + 'static, Fut: Future<Output = (Request<B>, Option<HeaderValue>)> + Send + 'static,

§

impl<F, Fut, B> MakeHeaderValueFn<B, ()> for F
where B: Send + 'static, F: Fn() -> Fut + Send + Sync + 'static, Fut: Future<Output = Option<HeaderValue>> + Send + 'static,