pub struct Header { /* private fields */ }
Expand description
A single header. Headers have a name (case insensitive) and a value. The character set for header and values are both restrictive.
-
Names must only contain a-zA-Z0-9 and and (‘!’ | ‘#’ | ‘$’ | ‘%’ | ‘&’ | ‘'’ | ‘*’ | ‘+’ | ‘-’ | ‘.’ | ‘^’ | ‘_’ | ‘`’ | ‘|’ | ‘~’) characters (the field-name token production defined at https://tools.ietf.org/html/rfc7230#section-3.2). For request headers, we expect these to all be specified statically, and so we panic if you provide an invalid one. (For response headers, we ignore headers with invalid names, but emit a warning).
Header names are case insensitive, and we have several pre-defined ones in the [
header_names
] module. -
Values may only contain printable ascii characters, and may not contain \r or \n. Strictly speaking, HTTP is more flexible for header values, however we don’t need to support binary header values, and so we do not.
Note that typically you should not interact with this directly, and instead
use the methods on [Request
] or Headers
to manipulate these.
Implementations§
Trait Implementations§
source§impl FromIterator<Header> for Headers
impl FromIterator<Header> for Headers
source§impl Ord for Header
impl Ord for Header
source§impl PartialOrd for Header
impl PartialOrd for Header
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.