pub struct Headers { /* private fields */ }Expand description
HTTP headers collection.
Implementations§
Source§impl Headers
impl Headers
Sourcepub fn contains(&self, name: &str) -> bool
pub fn contains(&self, name: &str) -> bool
Returns true if a header is present (case-insensitive).
Sourcepub fn insert_from_slice(&mut self, name: &str, value: &[u8])
pub fn insert_from_slice(&mut self, name: &str, value: &[u8])
Insert a header from borrowed name/value slices.
This is a convenience for parsers that already have &str/&[u8] and want
to avoid constructing intermediate owned buffers.
Sourcepub fn remove(&mut self, name: &str) -> Option<Vec<u8>>
pub fn remove(&mut self, name: &str) -> Option<Vec<u8>>
Remove a header value by name (case-insensitive).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Headers
impl RefUnwindSafe for Headers
impl Send for Headers
impl Sync for Headers
impl Unpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).