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,27 @@ use header::{self, Header, HeaderFormat, EntityTag, HttpDate};
/// # Example values
/// * `Sat, 29 Oct 1994 19:43:31 GMT`
/// * `\"xyzzy\"`
///
/// # Examples
/// ```
/// use hyper::header::{Headers, IfRange, EntityTag};
///
/// let mut headers = Headers::new();
/// headers.set(IfRange::EntityTag(EntityTag::new(false, "xyzzy".to_owned())));
/// ```
/// ```
/// # extern crate hyper;
/// # extern crate time;
/// # fn main() {
/// // extern crate time;
///
/// use hyper::header::{Headers, IfRange, HttpDate};
/// use time::{self, Duration};
///
/// let mut headers = Headers::new();
/// headers.set(IfRange::Date(HttpDate(time::now() - Duration::days(1))));
/// # }
/// ```
#[derive(Clone, Debug, PartialEq)]
pub enum IfRange {
/// The entity-tag the client has of the resource