pub struct Headers(/* private fields */);Expand description
HTTP header collection.
Header names are stored in normalized lowercase form for lookup, while the original raw casing is retained for serialization.
Implementations§
Source§impl Headers
impl Headers
Sourcepub fn iter(&self) -> impl Iterator<Item = (Vec<u8>, Vec<u8>)> + '_
pub fn iter(&self) -> impl Iterator<Item = (Vec<u8>, Vec<u8>)> + '_
Returns normalized (name, value) pairs.
Names are lowercase. Values preserve their stored bytes.
Sourcepub fn raw_items(&self) -> Vec<&(Vec<u8>, Vec<u8>, Vec<u8>)>
pub fn raw_items(&self) -> Vec<&(Vec<u8>, Vec<u8>, Vec<u8>)>
Returns raw (raw_name, normalized_name, value) header triples.
Sourcepub fn new<I, N, V>(headers: I) -> Result<Self, ProtocolError>
pub fn new<I, N, V>(headers: I) -> Result<Self, ProtocolError>
Builds and validates a header collection from byte-like name/value pairs.
This validates field syntax, normalizes names for lookup, preserves raw
name casing for output, and enforces Content-Length /
Transfer-Encoding consistency.
Trait Implementations§
Source§impl Ord for Headers
impl Ord for Headers
Source§impl PartialOrd for Headers
impl PartialOrd for Headers
impl Eq for Headers
impl StructuralPartialEq for Headers
Auto Trait Implementations§
impl Freeze for Headers
impl RefUnwindSafe for Headers
impl Send for Headers
impl Sync for Headers
impl Unpin for Headers
impl UnsafeUnpin for Headers
impl UnwindSafe for Headers
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
Mutably borrows from an owned value. Read more