pub trait HeaderValueGetter {
// Required methods
fn header_str<K>(&self, key: K) -> Result<&str, HeaderValueErr>
where K: AsHeaderName + Copy;
fn header_bytes<K>(&self, key: K) -> Result<&[u8], HeaderValueErr>
where K: AsHeaderName + Copy;
}
Expand description
Utility trait for getting header values from a request or response.
Required Methods§
Sourcefn header_str<K>(&self, key: K) -> Result<&str, HeaderValueErr>where
K: AsHeaderName + Copy,
fn header_str<K>(&self, key: K) -> Result<&str, HeaderValueErr>where
K: AsHeaderName + Copy,
Get a header value as a string.
Sourcefn header_bytes<K>(&self, key: K) -> Result<&[u8], HeaderValueErr>where
K: AsHeaderName + Copy,
fn header_bytes<K>(&self, key: K) -> Result<&[u8], HeaderValueErr>where
K: AsHeaderName + Copy,
Get a header value as a byte slice.
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.