hyperx/header/common/
from.rs

1header! {
2    /// `From` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.5.1)
3    ///
4    /// The `From` header field contains an Internet email address for a
5    /// human user who controls the requesting user agent.  The address ought
6    /// to be machine-usable.
7    ///
8    /// # ABNF
9    ///
10    /// ```text
11    /// From    = mailbox
12    /// mailbox = <mailbox, see [RFC5322], Section 3.4>
13    /// ```
14    ///
15    /// # Example
16    ///
17    /// ```
18    /// # extern crate http;
19    /// use hyperx::header::{From, TypedHeaders};
20    ///
21    /// let mut headers = http::HeaderMap::new();
22    /// headers.encode(&From("webmaster@example.org".to_owned()));
23    /// ```
24    // FIXME: Maybe use mailbox?
25    (From, "From") => [String]
26
27    test_from {
28        test_header!(test1, vec![b"webmaster@example.org"]);
29    }
30}
31
32standard_header!(From, FROM);