docs(headers): add header examples
This commit is contained in:
		| @@ -17,6 +17,31 @@ header! { | ||||
|     #[doc="* `GET, HEAD, PUT`"] | ||||
|     #[doc="* `OPTIONS, GET, PUT, POST, DELETE, HEAD, TRACE, CONNECT, PATCH, fOObAr`"] | ||||
|     #[doc="* ``"] | ||||
|     #[doc=""] | ||||
|     #[doc="# Examples"] | ||||
|     #[doc="```"] | ||||
|     #[doc="use hyper::header::{Headers, Allow};"] | ||||
|     #[doc="use hyper::method::Method;"] | ||||
|     #[doc=""] | ||||
|     #[doc="let mut headers = Headers::new();"] | ||||
|     #[doc="headers.set("] | ||||
|     #[doc="    Allow(vec![Method::Get])"] | ||||
|     #[doc=");"] | ||||
|     #[doc="```"] | ||||
|     #[doc="```"] | ||||
|     #[doc="use hyper::header::{Headers, Allow};"] | ||||
|     #[doc="use hyper::method::Method;"] | ||||
|     #[doc=""] | ||||
|     #[doc="let mut headers = Headers::new();"] | ||||
|     #[doc="headers.set("] | ||||
|     #[doc="    Allow(vec!["] | ||||
|     #[doc="        Method::Get,"] | ||||
|     #[doc="        Method::Post,"] | ||||
|     #[doc="        Method::Patch,"] | ||||
|     #[doc="        Method::Extension(\"COPY\".to_owned()),"] | ||||
|     #[doc="    ])"] | ||||
|     #[doc=");"] | ||||
|     #[doc="```"] | ||||
|     (Allow, "Allow") => (Method)* | ||||
|  | ||||
|     test_allow { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user