docs(headers): add header examples

This commit is contained in:
Chandler Latour
2015-05-28 08:55:32 -06:00
parent 5a9c41a2a1
commit c940e84a78
41 changed files with 856 additions and 0 deletions

View File

@@ -24,6 +24,26 @@ header! {
#[doc="# Example values"]
#[doc="* `\"xyzzy\"`"]
#[doc="* \"xyzzy\", \"r2d2xxxx\", \"c3piozzzz\""]
#[doc=""]
#[doc="# Examples"]
#[doc="```"]
#[doc="use hyper::header::{Headers, IfMatch};"]
#[doc=""]
#[doc="let mut headers = Headers::new();"]
#[doc="headers.set(IfMatch::Any);"]
#[doc="```"]
#[doc="```"]
#[doc="use hyper::header::{Headers, IfMatch, EntityTag};"]
#[doc=""]
#[doc="let mut headers = Headers::new();"]
#[doc="headers.set("]
#[doc=" IfMatch::Items(vec!["]
#[doc=" EntityTag::new(false, \"xyzzy\".to_owned()),"]
#[doc=" EntityTag::new(false, \"foobar\".to_owned()),"]
#[doc=" EntityTag::new(false, \"bazquux\".to_owned()),"]
#[doc=" ])"]
#[doc=");"]
#[doc="```"]
(IfMatch, "If-Match") => {Any / (EntityTag)+}
test_if_match {