pub trait MakeHeaderValue<T> {
    // Required method
    fn make_header_value(&mut self, message: &T) -> Option<HeaderValue>;
}
Available on crate feature set-header only.
Expand description

Trait for producing header values.

Used by SetRequestHeader and SetResponseHeader.

This trait is implemented for closures with the correct type signature. Typically users will not have to implement this trait for their own types.

It is also implemented directly for HeaderValue. When a fixed header value should be added to all responses, it can be supplied directly to the middleware.

Required Methods§

source

fn make_header_value(&mut self, message: &T) -> Option<HeaderValue>

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

Implementations on Foreign Types§

source§

impl<T> MakeHeaderValue<T> for Option<HeaderValue>

source§

fn make_header_value(&mut self, _message: &T) -> Option<HeaderValue>

source§

impl<T> MakeHeaderValue<T> for HeaderValue

source§

fn make_header_value(&mut self, _message: &T) -> Option<HeaderValue>

Implementors§

source§

impl<F, T> MakeHeaderValue<T> for Fwhere F: FnMut(&T) -> Option<HeaderValue>,