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]
pub fn from_bytes<B1, B2>(header: B1, value: B2) -> Result<Header, ()> where
B1: Into<Vec<u8>> + AsRef<[u8]>,
B2: Into<Vec<u8>> + AsRef<[u8]>, [src]
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 Debug for Header[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl Clone for Header[src]
fn clone(&self) -> Header[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl FromStr for Header[src]
type Err = ()
The associated error which can be returned from parsing.
fn from_str(input: &str) -> Result<Header, ()>[src]
Parses a string s to return a value of this type. Read more