Skip to main content

MakeHeaderValueFn

Trait MakeHeaderValueFn 

pub trait MakeHeaderValueFn<B, A>:
    Send
    + Sync
    + 'static {
    // Required method
    fn call(
        self,
        response: Response<B>,
    ) -> impl Future<Output = (Response<B>, Option<HeaderValue>)> + Send;
}
Available on crate feature http only.
Expand description

Functional version of MakeHeaderValue, to make it easier to create a (response) header maker directly from a response.

Required Methods§

fn call( self, response: Response<B>, ) -> impl Future<Output = (Response<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".

Implementors§

§

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

§

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