docs(headers): add header examples
This commit is contained in:
@@ -17,6 +17,21 @@ header! {
|
||||
#[doc=""]
|
||||
#[doc="# Example values"]
|
||||
#[doc="* `Thu, 01 Dec 1994 16:00:00 GMT`"]
|
||||
#[doc=""]
|
||||
#[doc="# Example"]
|
||||
#[doc="```"]
|
||||
#[doc="# extern crate hyper;"]
|
||||
#[doc="# extern crate time;"]
|
||||
#[doc="# fn main() {"]
|
||||
#[doc="// extern crate time;"]
|
||||
#[doc=""]
|
||||
#[doc="use hyper::header::{Headers, Expires, HttpDate};"]
|
||||
#[doc="use time::{self, Duration};"]
|
||||
#[doc=""]
|
||||
#[doc="let mut headers = Headers::new();"]
|
||||
#[doc="headers.set(Expires(HttpDate(time::now() + Duration::days(1))));"]
|
||||
#[doc="# }"]
|
||||
#[doc="```"]
|
||||
(Expires, "Expires") => [HttpDate]
|
||||
|
||||
test_expires {
|
||||
|
||||
Reference in New Issue
Block a user