Struct tiny_http::Header [] [src]

pub struct Header {
    pub field: HeaderField,
    pub value: AsciiString,
}

Represents a HTTP header.

Fields

field: HeaderField value: AsciiString

Methods

impl Header
[src]

fn from_bytes<B1, B2>(header: B1, value: B2) -> Result<Header()> where B1: Into<Vec<u8>> + AsRef<[u8]>, B2: Into<Vec<u8>> + AsRef<[u8]>

Builds a Header from two Vec<u8>s or two &[u8]s.

Example:

let header = tiny_http::Header::from_bytes(&b"Content-Type"[..], &b"text/plain"[..]).unwrap();

Trait Implementations

impl Clone for Header
[src]

fn clone(&self) -> Header

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Debug for Header
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl FromStr for Header
[src]

type Err = ()

The associated error which can be returned from parsing.

fn from_str(input: &str) -> Result<Header()>

Parses a string s to return a value of this type. Read more

impl Display for Header
[src]

fn fmt(&self, formatter: &mut Formatter) -> Result<()Error>

Formats the value using the given formatter.