docs(headers): add header examples
This commit is contained in:
		| @@ -62,6 +62,32 @@ header! { | ||||
|     #[doc="* `close`"] | ||||
|     #[doc="* `keep-alive`"] | ||||
|     #[doc="* `upgrade`"] | ||||
|     #[doc="```"] | ||||
|     #[doc=""] | ||||
|     #[doc="# Examples"] | ||||
|     #[doc="```"] | ||||
|     #[doc="use hyper::header::{Headers, Connection};"] | ||||
|     #[doc=""] | ||||
|     #[doc="let mut headers = Headers::new();"] | ||||
|     #[doc="headers.set(Connection::keep_alive());"] | ||||
|     #[doc="```"] | ||||
|     #[doc="```"] | ||||
|     #[doc="# extern crate hyper;"] | ||||
|     #[doc="# extern crate unicase;"] | ||||
|     #[doc="# fn main() {"] | ||||
|     #[doc="// extern crate unicase;"] | ||||
|     #[doc=""] | ||||
|     #[doc="use hyper::header::{Headers, Connection, ConnectionOption};"] | ||||
|     #[doc="use unicase::UniCase;"] | ||||
|     #[doc=""] | ||||
|     #[doc="let mut headers = Headers::new();"] | ||||
|     #[doc="headers.set("] | ||||
|     #[doc="    Connection(vec!["] | ||||
|     #[doc="        ConnectionOption::ConnectionHeader(UniCase(\"upgrade\".to_owned())),"] | ||||
|     #[doc="    ])"] | ||||
|     #[doc=");"] | ||||
|     #[doc="# }"] | ||||
|     #[doc="```"] | ||||
|     (Connection, "Connection") => (ConnectionOption)+ | ||||
|  | ||||
|     test_connection { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user