[−][src]Struct http_types::headers::Headers
A collection of HTTP Headers.
Implementations
impl Headers
[src]
pub fn insert(
&mut self,
name: impl TryInto<HeaderName>,
values: impl ToHeaderValues
) -> Result<Option<Vec<HeaderValue>>>
[src]
&mut self,
name: impl TryInto<HeaderName>,
values: impl ToHeaderValues
) -> Result<Option<Vec<HeaderValue>>>
Insert a header into the headers.
Not that this will replace all header values for a given header name.
If you wish to add header values for a header name that already exists
use Headers::append
pub fn append(
&mut self,
name: impl TryInto<HeaderName>,
values: impl ToHeaderValues
) -> Result<()>
[src]
&mut self,
name: impl TryInto<HeaderName>,
values: impl ToHeaderValues
) -> Result<()>
Append a header to the headers.
Unlike insert
this function will not override the contents of a header, but insert a
header if there aren't any. Or else append to the existing list of headers.
pub fn get(&self, name: &HeaderName) -> Option<&Vec<HeaderValue>>
[src]
Get a reference to a header.
pub fn get_mut(&mut self, name: &HeaderName) -> Option<&mut Vec<HeaderValue>>
[src]
Get a mutable reference to a header.
pub fn remove(&mut self, name: &HeaderName) -> Option<Vec<HeaderValue>>
[src]
Remove a header.
pub fn iter(&self) -> Iter
[src]
An iterator visiting all header pairs in arbitrary order.
pub fn iter_mut(&mut self) -> IterMut
[src]
An iterator visiting all header pairs in arbitrary order, with mutable references to the values.
pub fn names(&self) -> Names
[src]
An iterator visiting all header names in arbitrary order.
pub fn values(&self) -> Values
[src]
An iterator visiting all header values in arbitrary order.
Trait Implementations
impl AsMut<Headers> for Request
[src]
impl AsMut<Headers> for Response
[src]
impl AsRef<Headers> for Request
[src]
impl AsRef<Headers> for Response
[src]
impl Debug for Headers
[src]
impl IntoIterator for Headers
[src]
type Item = (HeaderName, Vec<HeaderValue>)
The type of the elements being iterated over.
type IntoIter = IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
Returns a iterator of references over the remaining items.
impl<'a> IntoIterator for &'a Headers
[src]
type Item = (&'a HeaderName, &'a Vec<HeaderValue>)
The type of the elements being iterated over.
type IntoIter = Iter<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a> IntoIterator for &'a mut Headers
[src]
Auto Trait Implementations
impl RefUnwindSafe for Headers
impl Send for Headers
impl Sync for Headers
impl Unpin for Headers
impl UnwindSafe for Headers
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,