Struct tiny_http::Header [−][src]
pub struct Header { pub field: HeaderField, pub value: AsciiString, }
Represents a HTTP header.
Fields
field: HeaderField
value: AsciiString
Implementations
impl Header
[src]
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
Auto Trait Implementations
impl RefUnwindSafe for Header
impl RefUnwindSafe for Header
impl UnwindSafe for Header
impl UnwindSafe for Header