[][src]Struct mini_async_http::Headers

pub struct Headers { /* fields omitted */ }

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?

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

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?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.