docs(headers): add header examples
This commit is contained in:
		| @@ -17,6 +17,34 @@ header! { | ||||
|     #[doc=""] | ||||
|     #[doc="# Example values"] | ||||
|     #[doc="* `accept-encoding, accept-language`"] | ||||
|     #[doc=""] | ||||
|     #[doc="# Example"] | ||||
|     #[doc="```"] | ||||
|     #[doc="use hyper::header::{Headers, Vary};"] | ||||
|     #[doc=""] | ||||
|     #[doc="let mut headers = Headers::new();"] | ||||
|     #[doc="headers.set(Vary::Any);"] | ||||
|     #[doc="```"] | ||||
|     #[doc=""] | ||||
|     #[doc="# Example"] | ||||
|     #[doc="```"] | ||||
|     #[doc="# extern crate hyper;"] | ||||
|     #[doc="# extern crate unicase;"] | ||||
|     #[doc="# fn main() {"] | ||||
|     #[doc="// extern crate unicase;"] | ||||
|     #[doc=""] | ||||
|     #[doc="use hyper::header::{Headers, Vary};"] | ||||
|     #[doc="use unicase::UniCase;"] | ||||
|     #[doc=""] | ||||
|     #[doc="let mut headers = Headers::new();"] | ||||
|     #[doc="headers.set("] | ||||
|     #[doc="    Vary::Items(vec!["] | ||||
|     #[doc="        UniCase(\"accept-encoding\".to_owned()),"] | ||||
|     #[doc="        UniCase(\"accept-language\".to_owned()),"] | ||||
|     #[doc="    ])"] | ||||
|     #[doc=");"] | ||||
|     #[doc="# }"] | ||||
|     #[doc="```"] | ||||
|     (Vary, "Vary") => {Any / (UniCase<String>)+} | ||||
|  | ||||
|     test_vary { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user