[−][src]Struct mini_async_http::Headers
The HTTP header map. All the names are not case sensitive.
Example
let mut headers = mini_async_http::Headers::new(); assert!(headers.get_header("missing").is_none()); headers.set_header("Content-type","text/plain"); assert_eq!(headers.get_header("content-type").unwrap(),"text/plain"); headers.set_header("Content-type","application/json"); assert_eq!(headers.get_header("content-type").unwrap(),"application/json");
Implementations
impl Headers
[src]
pub fn new() -> Headers
[src]
Init an empty header struct
pub fn set_header(&mut self, name: &str, value: &str)
[src]
Set the given header name to the given value. If the key already exists overwrite the value.
pub fn get_header(&self, name: &str) -> Option<&String>
[src]
Retrieve the value at the given key
pub fn iter(&self) -> HeaderIterator
[src]
Return an iterator over all the headers. All keys are lowercase
Trait Implementations
impl Clone for Headers
[src]
impl Debug for Headers
[src]
impl Default for Headers
[src]
impl IntoIterator for Headers
[src]
type Item = (String, String)
The type of the elements being iterated over.
type IntoIter = IntoIter<String, String>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl PartialEq<Headers> for 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[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>,