style(headers): use regular doc-comments inside macros

A bug (rust-lang/rust#23812) in rustc prevented the use of normal
comments inside macros but this has been fixed.
This commit is contained in:
Pyfisch
2015-10-27 19:19:05 +01:00
parent d16ef6d9d4
commit 4c756a9304
33 changed files with 1209 additions and 1209 deletions

View File

@@ -3,79 +3,79 @@ use mime::Mime;
use header::QualityItem; use header::QualityItem;
header! { header! {
#[doc="`Accept` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.3.2)"] /// `Accept` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.3.2)
#[doc=""] ///
#[doc="The `Accept` header field can be used by user agents to specify"] /// The `Accept` header field can be used by user agents to specify
#[doc="response media types that are acceptable. Accept header fields can"] /// response media types that are acceptable. Accept header fields can
#[doc="be used to indicate that the request is specifically limited to a"] /// be used to indicate that the request is specifically limited to a
#[doc="small set of desired types, as in the case of a request for an"] /// small set of desired types, as in the case of a request for an
#[doc="in-line image"] /// in-line image
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Accept = #( media-range [ accept-params ] )"] /// Accept = #( media-range [ accept-params ] )
#[doc=""] ///
#[doc="media-range = ( \"*/*\""] /// media-range = ( "*/*"
#[doc=" / ( type \"/\" \"*\" )"] /// / ( type "/" "*" )
#[doc=" / ( type \"/\" subtype )"] /// / ( type "/" subtype )
#[doc=" ) *( OWS \";\" OWS parameter )"] /// ) *( OWS ";" OWS parameter )
#[doc="accept-params = weight *( accept-ext )"] /// accept-params = weight *( accept-ext )
#[doc="accept-ext = OWS \";\" OWS token [ \"=\" ( token / quoted-string ) ]"] /// accept-ext = OWS ";" OWS token [ "=" ( token / quoted-string ) ]
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `audio/*; q=0.2, audio/basic` (`*` value won't parse correctly)"] /// * `audio/*; q=0.2, audio/basic` (`*` value won't parse correctly)
#[doc="* `text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c`"] /// * `text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Accept, qitem};"] /// use hyper::header::{Headers, Accept, qitem};
#[doc="use hyper::mime::{Mime, TopLevel, SubLevel};"] /// use hyper::mime::{Mime, TopLevel, SubLevel};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc=""] ///
#[doc="headers.set("] /// headers.set(
#[doc=" Accept(vec!["] /// Accept(vec![
#[doc=" qitem(Mime(TopLevel::Text, SubLevel::Html, vec![])),"] /// qitem(Mime(TopLevel::Text, SubLevel::Html, vec![])),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Accept, qitem};"] /// use hyper::header::{Headers, Accept, qitem};
#[doc="use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value};"] /// use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" Accept(vec!["] /// Accept(vec![
#[doc=" qitem(Mime(TopLevel::Application, SubLevel::Json,"] /// qitem(Mime(TopLevel::Application, SubLevel::Json,
#[doc=" vec![(Attr::Charset, Value::Utf8)])),"] /// vec![(Attr::Charset, Value::Utf8)])),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Accept, QualityItem, Quality, qitem};"] /// use hyper::header::{Headers, Accept, QualityItem, Quality, qitem};
#[doc="use hyper::mime::{Mime, TopLevel, SubLevel};"] /// use hyper::mime::{Mime, TopLevel, SubLevel};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc=""] ///
#[doc="headers.set("] /// headers.set(
#[doc=" Accept(vec!["] /// Accept(vec![
#[doc=" qitem(Mime(TopLevel::Text, SubLevel::Html, vec![])),"] /// qitem(Mime(TopLevel::Text, SubLevel::Html, vec![])),
#[doc=" qitem(Mime(TopLevel::Application,"] /// qitem(Mime(TopLevel::Application,
#[doc=" SubLevel::Ext(\"xhtml+xml\".to_owned()), vec![])),"] /// SubLevel::Ext("xhtml+xml".to_owned()), vec![])),
#[doc=" QualityItem::new(Mime(TopLevel::Application, SubLevel::Xml, vec![]),"] /// QualityItem::new(Mime(TopLevel::Application, SubLevel::Xml, vec![]),
#[doc=" Quality(900)),"] /// Quality(900)),
#[doc=" qitem(Mime(TopLevel::Image,"] /// qitem(Mime(TopLevel::Image,
#[doc=" SubLevel::Ext(\"webp\".to_owned()), vec![])),"] /// SubLevel::Ext("webp".to_owned()), vec![])),
#[doc=" QualityItem::new(Mime(TopLevel::Star, SubLevel::Star, vec![]),"] /// QualityItem::new(Mime(TopLevel::Star, SubLevel::Star, vec![]),
#[doc=" Quality(800))"] /// Quality(800))
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Notes"] /// # Notes
#[doc="* Using always Mime types to represent `media-range` differs from the ABNF."] /// * Using always Mime types to represent `media-range` differs from the ABNF.
#[doc="* **FIXME**: `accept-ext` is not supported."] /// * **FIXME**: `accept-ext` is not supported.
(Accept, "Accept") => (QualityItem<Mime>)+ (Accept, "Accept") => (QualityItem<Mime>)+
test_accept { test_accept {

View File

@@ -1,52 +1,52 @@
use header::{Charset, QualityItem}; use header::{Charset, QualityItem};
header! { header! {
#[doc="`Accept-Charset` header, defined in"] /// `Accept-Charset` header, defined in
#[doc="[RFC7231](http://tools.ietf.org/html/rfc7231#section-5.3.3)"] /// [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.3.3)
#[doc=""] ///
#[doc="The `Accept-Charset` header field can be sent by a user agent to"] /// The `Accept-Charset` header field can be sent by a user agent to
#[doc="indicate what charsets are acceptable in textual response content."] /// indicate what charsets are acceptable in textual response content.
#[doc="This field allows user agents capable of understanding more"] /// This field allows user agents capable of understanding more
#[doc="comprehensive or special-purpose charsets to signal that capability"] /// comprehensive or special-purpose charsets to signal that capability
#[doc="to an origin server that is capable of representing information in"] /// to an origin server that is capable of representing information in
#[doc="those charsets."] /// those charsets.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Accept-Charset = 1#( ( charset / \"*\" ) [ weight ] )"] /// Accept-Charset = 1#( ( charset / "*" ) [ weight ] )
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `iso-8859-5, unicode-1-1;q=0.8`"] /// * `iso-8859-5, unicode-1-1;q=0.8`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AcceptCharset, Charset, qitem};"] /// use hyper::header::{Headers, AcceptCharset, Charset, qitem};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AcceptCharset(vec![qitem(Charset::Us_Ascii)])"] /// AcceptCharset(vec![qitem(Charset::Us_Ascii)])
#[doc=");"] /// );
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AcceptCharset, Charset, Quality, QualityItem};"] /// use hyper::header::{Headers, AcceptCharset, Charset, Quality, QualityItem};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AcceptCharset(vec!["] /// AcceptCharset(vec![
#[doc=" QualityItem::new(Charset::Us_Ascii, Quality(900)),"] /// QualityItem::new(Charset::Us_Ascii, Quality(900)),
#[doc=" QualityItem::new(Charset::Iso_8859_10, Quality(200)),"] /// QualityItem::new(Charset::Iso_8859_10, Quality(200)),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AcceptCharset, Charset, qitem};"] /// use hyper::header::{Headers, AcceptCharset, Charset, qitem};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AcceptCharset(vec![qitem(Charset::Ext(\"utf-8\".to_owned()))])"] /// AcceptCharset(vec![qitem(Charset::Ext("utf-8".to_owned()))])
#[doc=");"] /// );
#[doc="```"] /// ```
(AcceptCharset, "Accept-Charset") => (QualityItem<Charset>)+ (AcceptCharset, "Accept-Charset") => (QualityItem<Charset>)+
test_accept_charset { test_accept_charset {

View File

@@ -1,61 +1,61 @@
use header::{Encoding, QualityItem}; use header::{Encoding, QualityItem};
header! { header! {
#[doc="`Accept-Encoding` header, defined in"] /// `Accept-Encoding` header, defined in
#[doc="[RFC7231](http://tools.ietf.org/html/rfc7231#section-5.3.4)"] /// [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.3.4)
#[doc=""] ///
#[doc="The `Accept-Encoding` header field can be used by user agents to"] /// The `Accept-Encoding` header field can be used by user agents to
#[doc="indicate what response content-codings are"] /// indicate what response content-codings are
#[doc="acceptable in the response. An `identity` token is used as a synonym"] /// acceptable in the response. An `identity` token is used as a synonym
#[doc="for \"no encoding\" in order to communicate when no encoding is"] /// for "no encoding" in order to communicate when no encoding is
#[doc="preferred."] /// preferred.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Accept-Encoding = #( codings [ weight ] )"] /// Accept-Encoding = #( codings [ weight ] )
#[doc="codings = content-coding / \"identity\" / \"*\""] /// codings = content-coding / "identity" / "*"
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `compress, gzip`"] /// * `compress, gzip`
#[doc="* ``"] /// * ``
#[doc="* `*`"] /// * `*`
#[doc="* `compress;q=0.5, gzip;q=1`"] /// * `compress;q=0.5, gzip;q=1`
#[doc="* `gzip;q=1.0, identity; q=0.5, *;q=0`"] /// * `gzip;q=1.0, identity; q=0.5, *;q=0`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AcceptEncoding, Encoding, qitem};"] /// use hyper::header::{Headers, AcceptEncoding, Encoding, qitem};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AcceptEncoding(vec![qitem(Encoding::Chunked)])"] /// AcceptEncoding(vec![qitem(Encoding::Chunked)])
#[doc=");"] /// );
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AcceptEncoding, Encoding, qitem};"] /// use hyper::header::{Headers, AcceptEncoding, Encoding, qitem};
#[doc=" "] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AcceptEncoding(vec!["] /// AcceptEncoding(vec![
#[doc=" qitem(Encoding::Chunked),"] /// qitem(Encoding::Chunked),
#[doc=" qitem(Encoding::Gzip),"] /// qitem(Encoding::Gzip),
#[doc=" qitem(Encoding::Deflate),"] /// qitem(Encoding::Deflate),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AcceptEncoding, Encoding, QualityItem, Quality, qitem};"] /// use hyper::header::{Headers, AcceptEncoding, Encoding, QualityItem, Quality, qitem};
#[doc=" "] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AcceptEncoding(vec!["] /// AcceptEncoding(vec![
#[doc=" qitem(Encoding::Chunked),"] /// qitem(Encoding::Chunked),
#[doc=" QualityItem::new(Encoding::Gzip, Quality(600)),"] /// QualityItem::new(Encoding::Gzip, Quality(600)),
#[doc=" QualityItem::new(Encoding::EncodingExt(\"*\".to_owned()), Quality(0)),"] /// QualityItem::new(Encoding::EncodingExt("*".to_owned()), Quality(0)),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
(AcceptEncoding, "Accept-Encoding") => (QualityItem<Encoding>)* (AcceptEncoding, "Accept-Encoding") => (QualityItem<Encoding>)*
test_accept_encoding { test_accept_encoding {

View File

@@ -2,54 +2,54 @@ use language_tags::LanguageTag;
use header::QualityItem; use header::QualityItem;
header! { header! {
#[doc="`Accept-Language` header, defined in"] /// `Accept-Language` header, defined in
#[doc="[RFC7231](http://tools.ietf.org/html/rfc7231#section-5.3.5)"] /// [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.3.5)
#[doc=""] ///
#[doc="The `Accept-Language` header field can be used by user agents to"] /// The `Accept-Language` header field can be used by user agents to
#[doc="indicate the set of natural languages that are preferred in the"] /// indicate the set of natural languages that are preferred in the
#[doc="response."] /// response.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Accept-Language = 1#( language-range [ weight ] )"] /// Accept-Language = 1#( language-range [ weight ] )
#[doc="language-range = <language-range, see [RFC4647], Section 2.1>"] /// language-range = <language-range, see [RFC4647], Section 2.1>
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `da, en-gb;q=0.8, en;q=0.7`"] /// * `da, en-gb;q=0.8, en;q=0.7`
#[doc="* `en-us;q=1.0, en;q=0.5, fr`"] /// * `en-us;q=1.0, en;q=0.5, fr`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::LanguageTag;"] /// use hyper::LanguageTag;
#[doc="use hyper::header::{Headers, AcceptLanguage, qitem};"] /// use hyper::header::{Headers, AcceptLanguage, qitem};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="let mut langtag: LanguageTag = Default::default();"] /// let mut langtag: LanguageTag = Default::default();
#[doc="langtag.language = Some(\"en\".to_owned());"] /// langtag.language = Some("en".to_owned());
#[doc="langtag.region = Some(\"US\".to_owned());"] /// langtag.region = Some("US".to_owned());
#[doc="headers.set("] /// headers.set(
#[doc=" AcceptLanguage(vec!["] /// AcceptLanguage(vec![
#[doc=" qitem(langtag),"] /// qitem(langtag),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# #[macro_use] extern crate language_tags;"] /// # #[macro_use] extern crate language_tags;
#[doc="# use hyper::header::{Headers, AcceptLanguage, QualityItem, Quality, qitem};"] /// # use hyper::header::{Headers, AcceptLanguage, QualityItem, Quality, qitem};
#[doc="# "] /// #
#[doc="# fn main() {"] /// # fn main() {
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AcceptLanguage(vec!["] /// AcceptLanguage(vec![
#[doc=" qitem(langtag!(da)),"] /// qitem(langtag!(da)),
#[doc=" QualityItem::new(langtag!(en;;;GB), Quality(800)),"] /// QualityItem::new(langtag!(en;;;GB), Quality(800)),
#[doc=" QualityItem::new(langtag!(en), Quality(700)),"] /// QualityItem::new(langtag!(en), Quality(700)),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="# }"] /// # }
#[doc="```"] /// ```
(AcceptLanguage, "Accept-Language") => (QualityItem<LanguageTag>)+ (AcceptLanguage, "Accept-Language") => (QualityItem<LanguageTag>)+
test_accept_language { test_accept_language {

View File

@@ -2,49 +2,49 @@ use std::fmt::{self, Display};
use std::str::FromStr; use std::str::FromStr;
header! { header! {
#[doc="`Accept-Ranges` header, defined in"] /// `Accept-Ranges` header, defined in
#[doc="[RFC7233](http://tools.ietf.org/html/rfc7233#section-2.3)"] /// [RFC7233](http://tools.ietf.org/html/rfc7233#section-2.3)
#[doc=""] ///
#[doc="The `Accept-Ranges` header field allows a server to indicate that it"] /// The `Accept-Ranges` header field allows a server to indicate that it
#[doc="supports range requests for the target resource."] /// supports range requests for the target resource.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Accept-Ranges = acceptable-ranges"] /// Accept-Ranges = acceptable-ranges
#[doc="acceptable-ranges = 1#range-unit / \"none\""] /// acceptable-ranges = 1#range-unit / \"none\"
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `bytes`"] /// * `bytes`
#[doc="* `none`"] /// * `none`
#[doc="* `unknown-unit`"] /// * `unknown-unit`
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AcceptRanges, RangeUnit};"] /// use hyper::header::{Headers, AcceptRanges, RangeUnit};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(AcceptRanges(vec![RangeUnit::Bytes]));"] /// headers.set(AcceptRanges(vec![RangeUnit::Bytes]));
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AcceptRanges, RangeUnit};"] /// use hyper::header::{Headers, AcceptRanges, RangeUnit};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(AcceptRanges(vec![RangeUnit::None]));"] /// headers.set(AcceptRanges(vec![RangeUnit::None]));
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AcceptRanges, RangeUnit};"] /// use hyper::header::{Headers, AcceptRanges, RangeUnit};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AcceptRanges(vec!["] /// AcceptRanges(vec![
#[doc=" RangeUnit::Unregistered(\"nibbles\".to_owned()),"] /// RangeUnit::Unregistered("nibbles".to_owned()),
#[doc=" RangeUnit::Bytes,"] /// RangeUnit::Bytes,
#[doc=" RangeUnit::Unregistered(\"doublets\".to_owned()),"] /// RangeUnit::Unregistered("doublets".to_owned()),
#[doc=" RangeUnit::Unregistered(\"quadlets\".to_owned()),"] /// RangeUnit::Unregistered("quadlets".to_owned()),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
(AcceptRanges, "Accept-Ranges") => (RangeUnit)+ (AcceptRanges, "Accept-Ranges") => (RangeUnit)+
test_acccept_ranges { test_acccept_ranges {

View File

@@ -1,55 +1,55 @@
use unicase::UniCase; use unicase::UniCase;
header! { header! {
#[doc="`Access-Control-Allow-Headers` header, part of"] /// `Access-Control-Allow-Headers` header, part of
#[doc="[CORS](http://www.w3.org/TR/cors/#access-control-allow-headers-response-header)"] /// [CORS](http://www.w3.org/TR/cors/#access-control-allow-headers-response-header)
#[doc=""] ///
#[doc="The `Access-Control-Allow-Headers` header indicates, as part of the"] /// The `Access-Control-Allow-Headers` header indicates, as part of the
#[doc="response to a preflight request, which header field names can be used"] /// response to a preflight request, which header field names can be used
#[doc="during the actual request."] /// during the actual request.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Access-Control-Allow-Headers: \"Access-Control-Allow-Headers\" \":\" #field-name"] /// Access-Control-Allow-Headers: "Access-Control-Allow-Headers" ":" #field-name
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `accept-language, date`"] /// * `accept-language, date`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# extern crate unicase;"] /// # extern crate unicase;
#[doc="# fn main() {"] /// # fn main() {
#[doc="// extern crate unicase;"] /// // extern crate unicase;
#[doc=""] ///
#[doc="use hyper::header::{Headers, AccessControlAllowHeaders};"] /// use hyper::header::{Headers, AccessControlAllowHeaders};
#[doc="use unicase::UniCase;"] /// use unicase::UniCase;
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AccessControlAllowHeaders(vec![UniCase(\"date\".to_owned())])"] /// AccessControlAllowHeaders(vec![UniCase("date".to_owned())])
#[doc=");"] /// );
#[doc="# }"] /// # }
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# extern crate unicase;"] /// # extern crate unicase;
#[doc="# fn main() {"] /// # fn main() {
#[doc="// extern crate unicase;"] /// // extern crate unicase;
#[doc=""] ///
#[doc="use hyper::header::{Headers, AccessControlAllowHeaders};"] /// use hyper::header::{Headers, AccessControlAllowHeaders};
#[doc="use unicase::UniCase;"] /// use unicase::UniCase;
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AccessControlAllowHeaders(vec!["] /// AccessControlAllowHeaders(vec![
#[doc=" UniCase(\"accept-language\".to_owned()),"] /// UniCase("accept-language".to_owned()),
#[doc=" UniCase(\"date\".to_owned()),"] /// UniCase("date".to_owned()),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="# }"] /// # }
#[doc="```"] /// ```
(AccessControlAllowHeaders, "Access-Control-Allow-Headers") => (UniCase<String>)* (AccessControlAllowHeaders, "Access-Control-Allow-Headers") => (UniCase<String>)*
test_access_control_allow_headers { test_access_control_allow_headers {

View File

@@ -1,45 +1,45 @@
use method::Method; use method::Method;
header! { header! {
#[doc="`Access-Control-Allow-Methods` header, part of"] /// `Access-Control-Allow-Methods` header, part of
#[doc="[CORS](http://www.w3.org/TR/cors/#access-control-allow-methods-response-header)"] /// [CORS](http://www.w3.org/TR/cors/#access-control-allow-methods-response-header)
#[doc=""] ///
#[doc="The `Access-Control-Allow-Methods` header indicates, as part of the"] /// The `Access-Control-Allow-Methods` header indicates, as part of the
#[doc="response to a preflight request, which methods can be used during the"] /// response to a preflight request, which methods can be used during the
#[doc="actual request."] /// actual request.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Access-Control-Allow-Methods: \"Access-Control-Allow-Methods\" \":\" #Method"] /// Access-Control-Allow-Methods: "Access-Control-Allow-Methods" ":" #Method
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `PUT, DELETE, XMODIFY`"] /// * `PUT, DELETE, XMODIFY`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AccessControlAllowMethods};"] /// use hyper::header::{Headers, AccessControlAllowMethods};
#[doc="use hyper::method::Method;"] /// use hyper::method::Method;
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AccessControlAllowMethods(vec![Method::Get])"] /// AccessControlAllowMethods(vec![Method::Get])
#[doc=");"] /// );
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AccessControlAllowMethods};"] /// use hyper::header::{Headers, AccessControlAllowMethods};
#[doc="use hyper::method::Method;"] /// use hyper::method::Method;
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AccessControlAllowMethods(vec!["] /// AccessControlAllowMethods(vec![
#[doc=" Method::Get,"] /// Method::Get,
#[doc=" Method::Post,"] /// Method::Post,
#[doc=" Method::Patch,"] /// Method::Patch,
#[doc=" Method::Extension(\"COPY\".to_owned()),"] /// Method::Extension("COPY".to_owned()),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
(AccessControlAllowMethods, "Access-Control-Allow-Methods") => (Method)* (AccessControlAllowMethods, "Access-Control-Allow-Methods") => (Method)*
test_access_control_allow_methods { test_access_control_allow_methods {

View File

@@ -1,25 +1,25 @@
header! { header! {
#[doc="`Access-Control-Max-Age` header, part of"] /// `Access-Control-Max-Age` header, part of
#[doc="[CORS](http://www.w3.org/TR/cors/#access-control-max-age-response-header)"] /// [CORS](http://www.w3.org/TR/cors/#access-control-max-age-response-header)
#[doc=""] ///
#[doc="The `Access-Control-Max-Age` header indicates how long the results of a"] /// The `Access-Control-Max-Age` header indicates how long the results of a
#[doc="preflight request can be cached in a preflight result cache."] /// preflight request can be cached in a preflight result cache.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Access-Control-Max-Age = \"Access-Control-Max-Age\" \":\" delta-seconds"] /// Access-Control-Max-Age = \"Access-Control-Max-Age\" \":\" delta-seconds
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `531`"] /// * `531`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AccessControlMaxAge};"] /// use hyper::header::{Headers, AccessControlMaxAge};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(AccessControlMaxAge(1728000u32));"] /// headers.set(AccessControlMaxAge(1728000u32));
#[doc="```"] /// ```
(AccessControlMaxAge, "Access-Control-Max-Age") => [u32] (AccessControlMaxAge, "Access-Control-Max-Age") => [u32]
test_access_control_max_age { test_access_control_max_age {

View File

@@ -1,55 +1,55 @@
use unicase::UniCase; use unicase::UniCase;
header! { header! {
#[doc="`Access-Control-Request-Headers` header, part of"] /// `Access-Control-Request-Headers` header, part of
#[doc="[CORS](http://www.w3.org/TR/cors/#access-control-request-headers-request-header)"] /// [CORS](http://www.w3.org/TR/cors/#access-control-request-headers-request-header)
#[doc=""] ///
#[doc="The `Access-Control-Request-Headers` header indicates which headers will"] /// The `Access-Control-Request-Headers` header indicates which headers will
#[doc="be used in the actual request as part of the preflight request."] /// be used in the actual request as part of the preflight request.
#[doc="during the actual request."] /// during the actual request.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Access-Control-Allow-Headers: \"Access-Control-Allow-Headers\" \":\" #field-name"] /// Access-Control-Allow-Headers: "Access-Control-Allow-Headers" ":" #field-name
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `accept-language, date`"] /// * `accept-language, date`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# extern crate unicase;"] /// # extern crate unicase;
#[doc="# fn main() {"] /// # fn main() {
#[doc="// extern crate unicase;"] /// // extern crate unicase;
#[doc=""] ///
#[doc="use hyper::header::{Headers, AccessControlRequestHeaders};"] /// use hyper::header::{Headers, AccessControlRequestHeaders};
#[doc="use unicase::UniCase;"] /// use unicase::UniCase;
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AccessControlRequestHeaders(vec![UniCase(\"date\".to_owned())])"] /// AccessControlRequestHeaders(vec![UniCase("date".to_owned())])
#[doc=");"] /// );
#[doc="# }"] /// # }
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# extern crate unicase;"] /// # extern crate unicase;
#[doc="# fn main() {"] /// # fn main() {
#[doc="// extern crate unicase;"] /// // extern crate unicase;
#[doc=""] ///
#[doc="use hyper::header::{Headers, AccessControlRequestHeaders};"] /// use hyper::header::{Headers, AccessControlRequestHeaders};
#[doc="use unicase::UniCase;"] /// use unicase::UniCase;
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" AccessControlRequestHeaders(vec!["] /// AccessControlRequestHeaders(vec![
#[doc=" UniCase(\"accept-language\".to_owned()),"] /// UniCase("accept-language".to_owned()),
#[doc=" UniCase(\"date\".to_owned()),"] /// UniCase("date".to_owned()),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="# }"] /// # }
#[doc="```"] /// ```
(AccessControlRequestHeaders, "Access-Control-Request-Headers") => (UniCase<String>)* (AccessControlRequestHeaders, "Access-Control-Request-Headers") => (UniCase<String>)*
test_access_control_request_headers { test_access_control_request_headers {

View File

@@ -1,27 +1,27 @@
use method::Method; use method::Method;
header! { header! {
#[doc="`Access-Control-Request-Method` header, part of"] /// `Access-Control-Request-Method` header, part of
#[doc="[CORS](http://www.w3.org/TR/cors/#access-control-request-method-request-header)"] /// [CORS](http://www.w3.org/TR/cors/#access-control-request-method-request-header)
#[doc=""] ///
#[doc="The `Access-Control-Request-Method` header indicates which method will be"] /// The `Access-Control-Request-Method` header indicates which method will be
#[doc="used in the actual request as part of the preflight request."] /// used in the actual request as part of the preflight request.
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Access-Control-Request-Method: \"Access-Control-Request-Method\" \":\" Method"] /// Access-Control-Request-Method: \"Access-Control-Request-Method\" \":\" Method
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `GET`"] /// * `GET`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, AccessControlRequestMethod};"] /// use hyper::header::{Headers, AccessControlRequestMethod};
#[doc="use hyper::method::Method;"] /// use hyper::method::Method;
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(AccessControlRequestMethod(Method::Get));"] /// headers.set(AccessControlRequestMethod(Method::Get));
#[doc="```"] /// ```
(AccessControlRequestMethod, "Access-Control-Request-Method") => [Method] (AccessControlRequestMethod, "Access-Control-Request-Method") => [Method]
test_access_control_request_method { test_access_control_request_method {

View File

@@ -1,47 +1,47 @@
use method::Method; use method::Method;
header! { header! {
#[doc="`Allow` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-7.4.1)"] /// `Allow` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-7.4.1)
#[doc=""] ///
#[doc="The `Allow` header field lists the set of methods advertised as"] /// The `Allow` header field lists the set of methods advertised as
#[doc="supported by the target resource. The purpose of this field is"] /// supported by the target resource. The purpose of this field is
#[doc="strictly to inform the recipient of valid request methods associated"] /// strictly to inform the recipient of valid request methods associated
#[doc="with the resource."] /// with the resource.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Allow = #method"] /// Allow = #method
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `GET, HEAD, PUT`"] /// * `GET, HEAD, PUT`
#[doc="* `OPTIONS, GET, PUT, POST, DELETE, HEAD, TRACE, CONNECT, PATCH, fOObAr`"] /// * `OPTIONS, GET, PUT, POST, DELETE, HEAD, TRACE, CONNECT, PATCH, fOObAr`
#[doc="* ``"] /// * ``
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Allow};"] /// use hyper::header::{Headers, Allow};
#[doc="use hyper::method::Method;"] /// use hyper::method::Method;
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" Allow(vec![Method::Get])"] /// Allow(vec![Method::Get])
#[doc=");"] /// );
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Allow};"] /// use hyper::header::{Headers, Allow};
#[doc="use hyper::method::Method;"] /// use hyper::method::Method;
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" Allow(vec!["] /// Allow(vec![
#[doc=" Method::Get,"] /// Method::Get,
#[doc=" Method::Post,"] /// Method::Post,
#[doc=" Method::Patch,"] /// Method::Patch,
#[doc=" Method::Extension(\"COPY\".to_owned()),"] /// Method::Extension("COPY".to_owned()),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
(Allow, "Allow") => (Method)* (Allow, "Allow") => (Method)*
test_allow { test_allow {

View File

@@ -49,50 +49,50 @@ impl Display for ConnectionOption {
} }
header! { header! {
#[doc="`Connection` header, defined in"] /// `Connection` header, defined in
#[doc="[RFC7230](http://tools.ietf.org/html/rfc7230#section-6.1)"] /// [RFC7230](http://tools.ietf.org/html/rfc7230#section-6.1)
#[doc=""] ///
#[doc="The `Connection` header field allows the sender to indicate desired"] /// The `Connection` header field allows the sender to indicate desired
#[doc="control options for the current connection. In order to avoid"] /// control options for the current connection. In order to avoid
#[doc="confusing downstream recipients, a proxy or gateway MUST remove or"] /// confusing downstream recipients, a proxy or gateway MUST remove or
#[doc="replace any received connection options before forwarding the"] /// replace any received connection options before forwarding the
#[doc="message."] /// message.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Connection = 1#connection-option"] /// Connection = 1#connection-option
#[doc="connection-option = token"] /// connection-option = token
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `close`"] /// * `close`
#[doc="* `keep-alive`"] /// * `keep-alive`
#[doc="* `upgrade`"] /// * `upgrade`
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Connection};"] /// use hyper::header::{Headers, Connection};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(Connection::keep_alive());"] /// headers.set(Connection::keep_alive());
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# extern crate unicase;"] /// # extern crate unicase;
#[doc="# fn main() {"] /// # fn main() {
#[doc="// extern crate unicase;"] /// // extern crate unicase;
#[doc=""] ///
#[doc="use hyper::header::{Headers, Connection, ConnectionOption};"] /// use hyper::header::{Headers, Connection, ConnectionOption};
#[doc="use unicase::UniCase;"] /// use unicase::UniCase;
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" Connection(vec!["] /// Connection(vec![
#[doc=" ConnectionOption::ConnectionHeader(UniCase(\"upgrade\".to_owned())),"] /// ConnectionOption::ConnectionHeader(UniCase("upgrade".to_owned())),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="# }"] /// # }
#[doc="```"] /// ```
(Connection, "Connection") => (ConnectionOption)+ (Connection, "Connection") => (ConnectionOption)+
test_connection { test_connection {

View File

@@ -1,43 +1,43 @@
use header::Encoding; use header::Encoding;
header! { header! {
#[doc="`Content-Encoding` header, defined in"] /// `Content-Encoding` header, defined in
#[doc="[RFC7231](http://tools.ietf.org/html/rfc7231#section-3.1.2.2)"] /// [RFC7231](http://tools.ietf.org/html/rfc7231#section-3.1.2.2)
#[doc=""] ///
#[doc="The `Content-Encoding` header field indicates what content codings"] /// The `Content-Encoding` header field indicates what content codings
#[doc="have been applied to the representation, beyond those inherent in the"] /// have been applied to the representation, beyond those inherent in the
#[doc="media type, and thus what decoding mechanisms have to be applied in"] /// media type, and thus what decoding mechanisms have to be applied in
#[doc="order to obtain data in the media type referenced by the Content-Type"] /// order to obtain data in the media type referenced by the Content-Type
#[doc="header field. Content-Encoding is primarily used to allow a"] /// header field. Content-Encoding is primarily used to allow a
#[doc="representation's data to be compressed without losing the identity of"] /// representation's data to be compressed without losing the identity of
#[doc="its underlying media type."] /// its underlying media type.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Content-Encoding = 1#content-coding"] /// Content-Encoding = 1#content-coding
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `gzip`"] /// * `gzip`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, ContentEncoding, Encoding};"] /// use hyper::header::{Headers, ContentEncoding, Encoding};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(ContentEncoding(vec![Encoding::Chunked]));"] /// headers.set(ContentEncoding(vec![Encoding::Chunked]));
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, ContentEncoding, Encoding};"] /// use hyper::header::{Headers, ContentEncoding, Encoding};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" ContentEncoding(vec!["] /// ContentEncoding(vec![
#[doc=" Encoding::Gzip,"] /// Encoding::Gzip,
#[doc=" Encoding::Chunked,"] /// Encoding::Chunked,
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
(ContentEncoding, "Content-Encoding") => (Encoding)+ (ContentEncoding, "Content-Encoding") => (Encoding)+
test_content_encoding { test_content_encoding {

View File

@@ -2,54 +2,54 @@ use language_tags::LanguageTag;
use header::QualityItem; use header::QualityItem;
header! { header! {
#[doc="`Content-Language` header, defined in"] /// `Content-Language` header, defined in
#[doc="[RFC7231](https://tools.ietf.org/html/rfc7231#section-3.1.3.2)"] /// [RFC7231](https://tools.ietf.org/html/rfc7231#section-3.1.3.2)
#[doc=""] ///
#[doc="The `Content-Language` header field describes the natural language(s)"] /// The `Content-Language` header field describes the natural language(s)
#[doc="of the intended audience for the representation. Note that this"] /// of the intended audience for the representation. Note that this
#[doc="might not be equivalent to all the languages used within the"] /// might not be equivalent to all the languages used within the
#[doc="representation."] /// representation.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Content-Language = 1#language-tag"] /// Content-Language = 1#language-tag
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `da`"] /// * `da`
#[doc="* `mi, en`"] /// * `mi, en`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# #[macro_use] extern crate language_tags;"] /// # #[macro_use] extern crate language_tags;
#[doc="# use hyper::header::{Headers, ContentLanguage, qitem};"] /// # use hyper::header::{Headers, ContentLanguage, qitem};
#[doc="# "] /// #
#[doc="# fn main() {"] /// # fn main() {
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" ContentLanguage(vec!["] /// ContentLanguage(vec![
#[doc=" qitem(langtag!(en)),"] /// qitem(langtag!(en)),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="# }"] /// # }
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# #[macro_use] extern crate language_tags;"] /// # #[macro_use] extern crate language_tags;
#[doc="# use hyper::header::{Headers, ContentLanguage, qitem};"] /// # use hyper::header::{Headers, ContentLanguage, qitem};
#[doc="# "] /// #
#[doc="# fn main() {"] /// # fn main() {
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" ContentLanguage(vec!["] /// ContentLanguage(vec![
#[doc=" qitem(langtag!(da)),"] /// qitem(langtag!(da)),
#[doc=" qitem(langtag!(en;;;GB)),"] /// qitem(langtag!(en;;;GB)),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="# }"] /// # }
#[doc="```"] /// ```
(ContentLanguage, "Content-Language") => (QualityItem<LanguageTag>)+ (ContentLanguage, "Content-Language") => (QualityItem<LanguageTag>)+
test_content_language { test_content_language {

View File

@@ -2,33 +2,33 @@ use std::fmt;
use header::{HeaderFormat, Header, parsing}; use header::{HeaderFormat, Header, parsing};
#[doc="`Content-Length` header, defined in"] /// `Content-Length` header, defined in
#[doc="[RFC7230](http://tools.ietf.org/html/rfc7230#section-3.3.2)"] /// [RFC7230](http://tools.ietf.org/html/rfc7230#section-3.3.2)
#[doc=""] ///
#[doc="When a message does not have a `Transfer-Encoding` header field, a"] /// When a message does not have a `Transfer-Encoding` header field, a
#[doc="Content-Length header field can provide the anticipated size, as a"] /// Content-Length header field can provide the anticipated size, as a
#[doc="decimal number of octets, for a potential payload body. For messages"] /// decimal number of octets, for a potential payload body. For messages
#[doc="that do include a payload body, the Content-Length field-value"] /// that do include a payload body, the Content-Length field-value
#[doc="provides the framing information necessary for determining where the"] /// provides the framing information necessary for determining where the
#[doc="body (and message) ends. For messages that do not include a payload"] /// body (and message) ends. For messages that do not include a payload
#[doc="body, the Content-Length indicates the size of the selected"] /// body, the Content-Length indicates the size of the selected
#[doc="representation."] /// representation.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Content-Length = 1*DIGIT"] /// Content-Length = 1*DIGIT
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `3495`"] /// * `3495`
#[doc=""] ///
#[doc="# Example"] /// # Example
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, ContentLength};"] /// use hyper::header::{Headers, ContentLength};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(ContentLength(1024u64));"] /// headers.set(ContentLength(1024u64));
#[doc="```"] /// ```
#[derive(Clone, Copy, Debug, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq)]
pub struct ContentLength(pub u64); pub struct ContentLength(pub u64);

View File

@@ -2,8 +2,8 @@ use std::fmt::{self, Display};
use std::str::FromStr; use std::str::FromStr;
header! { header! {
#[doc="`Content-Range` header, defined in"] /// `Content-Range` header, defined in
#[doc="[RFC7233](http://tools.ietf.org/html/rfc7233#section-4.2)"] /// [RFC7233](http://tools.ietf.org/html/rfc7233#section-4.2)
(ContentRange, "Content-Range") => [ContentRangeSpec] (ContentRange, "Content-Range") => [ContentRangeSpec]
test_content_range { test_content_range {

View File

@@ -1,47 +1,47 @@
use mime::Mime; use mime::Mime;
header! { header! {
#[doc="`Content-Type` header, defined in"] /// `Content-Type` header, defined in
#[doc="[RFC7231](http://tools.ietf.org/html/rfc7231#section-3.1.1.5)"] /// [RFC7231](http://tools.ietf.org/html/rfc7231#section-3.1.1.5)
#[doc=""] ///
#[doc="The `Content-Type` header field indicates the media type of the"] /// The `Content-Type` header field indicates the media type of the
#[doc="associated representation: either the representation enclosed in the"] /// associated representation: either the representation enclosed in the
#[doc="message payload or the selected representation, as determined by the"] /// message payload or the selected representation, as determined by the
#[doc="message semantics. The indicated media type defines both the data"] /// message semantics. The indicated media type defines both the data
#[doc="format and how that data is intended to be processed by a recipient,"] /// format and how that data is intended to be processed by a recipient,
#[doc="within the scope of the received message semantics, after any content"] /// within the scope of the received message semantics, after any content
#[doc="codings indicated by Content-Encoding are decoded."] /// codings indicated by Content-Encoding are decoded.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Content-Type = media-type"] /// Content-Type = media-type
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `text/html; charset=ISO-8859-4`"] /// * `text/html; charset=ISO-8859-4`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, ContentType};"] /// use hyper::header::{Headers, ContentType};
#[doc="use hyper::mime::{Mime, TopLevel, SubLevel};"] /// use hyper::mime::{Mime, TopLevel, SubLevel};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc=""] ///
#[doc="headers.set("] /// headers.set(
#[doc=" ContentType(Mime(TopLevel::Text, SubLevel::Html, vec![]))"] /// ContentType(Mime(TopLevel::Text, SubLevel::Html, vec![]))
#[doc=");"] /// );
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, ContentType};"] /// use hyper::header::{Headers, ContentType};
#[doc="use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value};"] /// use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc=""] ///
#[doc="headers.set("] /// headers.set(
#[doc=" ContentType(Mime(TopLevel::Application, SubLevel::Json,"] /// ContentType(Mime(TopLevel::Application, SubLevel::Json,
#[doc=" vec![(Attr::Charset, Value::Utf8)]))"] /// vec![(Attr::Charset, Value::Utf8)]))
#[doc=");"] /// );
#[doc="```"] /// ```
(ContentType, "Content-Type") => [Mime] (ContentType, "Content-Type") => [Mime]
test_content_type { test_content_type {

View File

@@ -1,33 +1,33 @@
use header::HttpDate; use header::HttpDate;
header! { header! {
#[doc="`Date` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-7.1.1.2)"] /// `Date` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-7.1.1.2)
#[doc=""] ///
#[doc="The `Date` header field represents the date and time at which the"] /// The `Date` header field represents the date and time at which the
#[doc="message was originated."] /// message was originated.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Date = HTTP-date"] /// Date = HTTP-date
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `Tue, 15 Nov 1994 08:12:31 GMT`"] /// * `Tue, 15 Nov 1994 08:12:31 GMT`
#[doc=""] ///
#[doc="# Example"] /// # Example
#[doc="```"] /// ```
#[doc="# extern crate time;"] /// # extern crate time;
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# fn main() {"] /// # fn main() {
#[doc="// extern crate time;"] /// // extern crate time;
#[doc=""] ///
#[doc="use hyper::header::{Headers, Date, HttpDate};"] /// use hyper::header::{Headers, Date, HttpDate};
#[doc="use time;"] /// use time;
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(Date(HttpDate(time::now())));"] /// headers.set(Date(HttpDate(time::now())));
#[doc="# }"] /// # }
#[doc="```"] /// ```
(Date, "Date") => [HttpDate] (Date, "Date") => [HttpDate]
test_date { test_date {

View File

@@ -1,41 +1,41 @@
use header::EntityTag; use header::EntityTag;
header! { header! {
#[doc="`ETag` header, defined in [RFC7232](http://tools.ietf.org/html/rfc7232#section-2.3)"] /// `ETag` header, defined in [RFC7232](http://tools.ietf.org/html/rfc7232#section-2.3)
#[doc=""] ///
#[doc="The `ETag` header field in a response provides the current entity-tag"] /// The `ETag` header field in a response provides the current entity-tag
#[doc="for the selected representation, as determined at the conclusion of"] /// for the selected representation, as determined at the conclusion of
#[doc="handling the request. An entity-tag is an opaque validator for"] /// handling the request. An entity-tag is an opaque validator for
#[doc="differentiating between multiple representations of the same"] /// differentiating between multiple representations of the same
#[doc="resource, regardless of whether those multiple representations are"] /// resource, regardless of whether those multiple representations are
#[doc="due to resource state changes over time, content negotiation"] /// due to resource state changes over time, content negotiation
#[doc="resulting in multiple representations being valid at the same time,"] /// resulting in multiple representations being valid at the same time,
#[doc="or both. An entity-tag consists of an opaque quoted string, possibly"] /// or both. An entity-tag consists of an opaque quoted string, possibly
#[doc="prefixed by a weakness indicator."] /// prefixed by a weakness indicator.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="ETag = entity-tag"] /// ETag = entity-tag
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `\"xyzzy\"`"] /// * `"xyzzy"`
#[doc="* `W/\"xyzzy\"`"] /// * `W/"xyzzy"`
#[doc="* `\"\"`"] /// * `""`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, ETag, EntityTag};"] /// use hyper::header::{Headers, ETag, EntityTag};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(ETag(EntityTag::new(false, \"xyzzy\".to_owned())));"] /// headers.set(ETag(EntityTag::new(false, "xyzzy".to_owned())));
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, ETag, EntityTag};"] /// use hyper::header::{Headers, ETag, EntityTag};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(ETag(EntityTag::new(true, \"xyzzy\".to_owned())));"] /// headers.set(ETag(EntityTag::new(true, "xyzzy".to_owned())));
#[doc="```"] /// ```
(ETag, "ETag") => [EntityTag] (ETag, "ETag") => [EntityTag]
test_etag { test_etag {

View File

@@ -1,37 +1,37 @@
use header::HttpDate; use header::HttpDate;
header! { header! {
#[doc="`Expires` header, defined in [RFC7234](http://tools.ietf.org/html/rfc7234#section-5.3)"] /// `Expires` header, defined in [RFC7234](http://tools.ietf.org/html/rfc7234#section-5.3)
#[doc=""] ///
#[doc="The `Expires` header field gives the date/time after which the"] /// The `Expires` header field gives the date/time after which the
#[doc="response is considered stale."] /// response is considered stale.
#[doc=""] ///
#[doc="The presence of an Expires field does not imply that the original"] /// The presence of an Expires field does not imply that the original
#[doc="resource will change or cease to exist at, before, or after that"] /// resource will change or cease to exist at, before, or after that
#[doc="time."] /// time.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Expires = HTTP-date"] /// Expires = HTTP-date
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `Thu, 01 Dec 1994 16:00:00 GMT`"] /// * `Thu, 01 Dec 1994 16:00:00 GMT`
#[doc=""] ///
#[doc="# Example"] /// # Example
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# extern crate time;"] /// # extern crate time;
#[doc="# fn main() {"] /// # fn main() {
#[doc="// extern crate time;"] /// // extern crate time;
#[doc=""] ///
#[doc="use hyper::header::{Headers, Expires, HttpDate};"] /// use hyper::header::{Headers, Expires, HttpDate};
#[doc="use time::{self, Duration};"] /// use time::{self, Duration};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(Expires(HttpDate(time::now() + Duration::days(1))));"] /// headers.set(Expires(HttpDate(time::now() + Duration::days(1))));
#[doc="# }"] /// # }
#[doc="```"] /// ```
(Expires, "Expires") => [HttpDate] (Expires, "Expires") => [HttpDate]
test_expires { test_expires {

View File

@@ -1,22 +1,22 @@
header! { header! {
#[doc="`From` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.5.1)"] /// `From` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.5.1)
#[doc=""] ///
#[doc="The `From` header field contains an Internet email address for a"] /// The `From` header field contains an Internet email address for a
#[doc="human user who controls the requesting user agent. The address ought"] /// human user who controls the requesting user agent. The address ought
#[doc="to be machine-usable."] /// to be machine-usable.
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="From = mailbox"] /// From = mailbox
#[doc="mailbox = <mailbox, see [RFC5322], Section 3.4>"] /// mailbox = <mailbox, see [RFC5322], Section 3.4>
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example"] /// # Example
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, From};"] /// use hyper::header::{Headers, From};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(From(\"webmaster@example.org\".to_owned()));"] /// headers.set(From("webmaster@example.org".to_owned()));
#[doc="```"] /// ```
// FIXME: Maybe use mailbox? // FIXME: Maybe use mailbox?
(From, "From") => [String] (From, "From") => [String]

View File

@@ -1,49 +1,49 @@
use header::EntityTag; use header::EntityTag;
header! { header! {
#[doc="`If-Match` header, defined in"] /// `If-Match` header, defined in
#[doc="[RFC7232](https://tools.ietf.org/html/rfc7232#section-3.1)"] /// [RFC7232](https://tools.ietf.org/html/rfc7232#section-3.1)
#[doc=""] ///
#[doc="The `If-Match` header field makes the request method conditional on"] /// The `If-Match` header field makes the request method conditional on
#[doc="the recipient origin server either having at least one current"] /// the recipient origin server either having at least one current
#[doc="representation of the target resource, when the field-value is \"*\","] /// representation of the target resource, when the field-value is "*",
#[doc="or having a current representation of the target resource that has an"] /// or having a current representation of the target resource that has an
#[doc="entity-tag matching a member of the list of entity-tags provided in"] /// entity-tag matching a member of the list of entity-tags provided in
#[doc="the field-value."] /// the field-value.
#[doc=""] ///
#[doc="An origin server MUST use the strong comparison function when"] /// An origin server MUST use the strong comparison function when
#[doc="comparing entity-tags for `If-Match`, since the client"] /// comparing entity-tags for `If-Match`, since the client
#[doc="intends this precondition to prevent the method from being applied if"] /// intends this precondition to prevent the method from being applied if
#[doc="there have been any changes to the representation data."] /// there have been any changes to the representation data.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="If-Match = \"*\" / 1#entity-tag"] /// If-Match = "*" / 1#entity-tag
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `\"xyzzy\"`"] /// * `"xyzzy"`
#[doc="* \"xyzzy\", \"r2d2xxxx\", \"c3piozzzz\""] /// * "xyzzy", "r2d2xxxx", "c3piozzzz"
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, IfMatch};"] /// use hyper::header::{Headers, IfMatch};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(IfMatch::Any);"] /// headers.set(IfMatch::Any);
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, IfMatch, EntityTag};"] /// use hyper::header::{Headers, IfMatch, EntityTag};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" IfMatch::Items(vec!["] /// IfMatch::Items(vec![
#[doc=" EntityTag::new(false, \"xyzzy\".to_owned()),"] /// EntityTag::new(false, "xyzzy".to_owned()),
#[doc=" EntityTag::new(false, \"foobar\".to_owned()),"] /// EntityTag::new(false, "foobar".to_owned()),
#[doc=" EntityTag::new(false, \"bazquux\".to_owned()),"] /// EntityTag::new(false, "bazquux".to_owned()),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
(IfMatch, "If-Match") => {Any / (EntityTag)+} (IfMatch, "If-Match") => {Any / (EntityTag)+}
test_if_match { test_if_match {

View File

@@ -1,37 +1,37 @@
use header::HttpDate; use header::HttpDate;
header! { header! {
#[doc="`If-Modified-Since` header, defined in"] /// `If-Modified-Since` header, defined in
#[doc="[RFC7232](http://tools.ietf.org/html/rfc7232#section-3.3)"] /// [RFC7232](http://tools.ietf.org/html/rfc7232#section-3.3)
#[doc=""] ///
#[doc="The `If-Modified-Since` header field makes a GET or HEAD request"] /// The `If-Modified-Since` header field makes a GET or HEAD request
#[doc="method conditional on the selected representation's modification date"] /// method conditional on the selected representation's modification date
#[doc="being more recent than the date provided in the field-value."] /// being more recent than the date provided in the field-value.
#[doc="Transfer of the selected representation's data is avoided if that"] /// Transfer of the selected representation's data is avoided if that
#[doc="data has not changed."] /// data has not changed.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="If-Unmodified-Since = HTTP-date"] /// If-Unmodified-Since = HTTP-date
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `Sat, 29 Oct 1994 19:43:31 GMT`"] /// * `Sat, 29 Oct 1994 19:43:31 GMT`
#[doc=""] ///
#[doc="# Example"] /// # Example
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# extern crate time;"] /// # extern crate time;
#[doc="# fn main() {"] /// # fn main() {
#[doc="// extern crate time;"] /// // extern crate time;
#[doc=""] ///
#[doc="use hyper::header::{Headers, IfModifiedSince, HttpDate};"] /// use hyper::header::{Headers, IfModifiedSince, HttpDate};
#[doc="use time::{self, Duration};"] /// use time::{self, Duration};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(IfModifiedSince(HttpDate(time::now() - Duration::days(1))));"] /// headers.set(IfModifiedSince(HttpDate(time::now() - Duration::days(1))));
#[doc="# }"] /// # }
#[doc="```"] /// ```
(IfModifiedSince, "If-Modified-Since") => [HttpDate] (IfModifiedSince, "If-Modified-Since") => [HttpDate]
test_if_modified_since { test_if_modified_since {

View File

@@ -1,51 +1,51 @@
use header::EntityTag; use header::EntityTag;
header! { header! {
#[doc="`If-None-Match` header, defined in"] /// `If-None-Match` header, defined in
#[doc="[RFC7232](https://tools.ietf.org/html/rfc7232#section-3.2)"] /// [RFC7232](https://tools.ietf.org/html/rfc7232#section-3.2)
#[doc=""] ///
#[doc="The `If-None-Match` header field makes the request method conditional"] /// The `If-None-Match` header field makes the request method conditional
#[doc="on a recipient cache or origin server either not having any current"] /// on a recipient cache or origin server either not having any current
#[doc="representation of the target resource, when the field-value is \"*\","] /// representation of the target resource, when the field-value is "*",
#[doc="or having a selected representation with an entity-tag that does not"] /// or having a selected representation with an entity-tag that does not
#[doc="match any of those listed in the field-value."] /// match any of those listed in the field-value.
#[doc=""] ///
#[doc="A recipient MUST use the weak comparison function when comparing"] /// A recipient MUST use the weak comparison function when comparing
#[doc="entity-tags for If-None-Match (Section 2.3.2), since weak entity-tags"] /// entity-tags for If-None-Match (Section 2.3.2), since weak entity-tags
#[doc="can be used for cache validation even if there have been changes to"] /// can be used for cache validation even if there have been changes to
#[doc="the representation data."] /// the representation data.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="If-None-Match = \"*\" / 1#entity-tag"] /// If-None-Match = "*" / 1#entity-tag
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `\"xyzzy\"`"] /// * `"xyzzy"`
#[doc="* `W/\"xyzzy\"`"] /// * `W/"xyzzy"`
#[doc="* `\"xyzzy\", \"r2d2xxxx\", \"c3piozzzz\"`"] /// * `"xyzzy", "r2d2xxxx", "c3piozzzz"`
#[doc="* `W/\"xyzzy\", W/\"r2d2xxxx\", W/\"c3piozzzz\"`"] /// * `W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"`
#[doc="* `*`"] /// * `*`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, IfNoneMatch};"] /// use hyper::header::{Headers, IfNoneMatch};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(IfNoneMatch::Any);"] /// headers.set(IfNoneMatch::Any);
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, IfNoneMatch, EntityTag};"] /// use hyper::header::{Headers, IfNoneMatch, EntityTag};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" IfNoneMatch::Items(vec!["] /// IfNoneMatch::Items(vec![
#[doc=" EntityTag::new(false, \"xyzzy\".to_owned()),"] /// EntityTag::new(false, "xyzzy".to_owned()),
#[doc=" EntityTag::new(false, \"foobar\".to_owned()),"] /// EntityTag::new(false, "foobar".to_owned()),
#[doc=" EntityTag::new(false, \"bazquux\".to_owned()),"] /// EntityTag::new(false, "bazquux".to_owned()),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
(IfNoneMatch, "If-None-Match") => {Any / (EntityTag)+} (IfNoneMatch, "If-None-Match") => {Any / (EntityTag)+}
test_if_none_match { test_if_none_match {

View File

@@ -1,37 +1,37 @@
use header::HttpDate; use header::HttpDate;
header! { header! {
#[doc="`If-Unmodified-Since` header, defined in"] /// `If-Unmodified-Since` header, defined in
#[doc="[RFC7232](http://tools.ietf.org/html/rfc7232#section-3.4)"] /// [RFC7232](http://tools.ietf.org/html/rfc7232#section-3.4)
#[doc=""] ///
#[doc="The `If-Unmodified-Since` header field makes the request method"] /// The `If-Unmodified-Since` header field makes the request method
#[doc="conditional on the selected representation's last modification date"] /// conditional on the selected representation's last modification date
#[doc="being earlier than or equal to the date provided in the field-value."] /// being earlier than or equal to the date provided in the field-value.
#[doc="This field accomplishes the same purpose as If-Match for cases where"] /// This field accomplishes the same purpose as If-Match for cases where
#[doc="the user agent does not have an entity-tag for the representation."] /// the user agent does not have an entity-tag for the representation.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="If-Unmodified-Since = HTTP-date"] /// If-Unmodified-Since = HTTP-date
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `Sat, 29 Oct 1994 19:43:31 GMT`"] /// * `Sat, 29 Oct 1994 19:43:31 GMT`
#[doc=""] ///
#[doc="# Example"] /// # Example
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# extern crate time;"] /// # extern crate time;
#[doc="# fn main() {"] /// # fn main() {
#[doc="// extern crate time;"] /// // extern crate time;
#[doc=""] ///
#[doc="use hyper::header::{Headers, IfUnmodifiedSince, HttpDate};"] /// use hyper::header::{Headers, IfUnmodifiedSince, HttpDate};
#[doc="use time::{self, Duration};"] /// use time::{self, Duration};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(IfUnmodifiedSince(HttpDate(time::now() - Duration::days(1))));"] /// headers.set(IfUnmodifiedSince(HttpDate(time::now() - Duration::days(1))));
#[doc="# }"] /// # }
#[doc="```"] /// ```
(IfUnmodifiedSince, "If-Unmodified-Since") => [HttpDate] (IfUnmodifiedSince, "If-Unmodified-Since") => [HttpDate]
test_if_unmodified_since { test_if_unmodified_since {

View File

@@ -1,36 +1,36 @@
use header::HttpDate; use header::HttpDate;
header! { header! {
#[doc="`Last-Modified` header, defined in"] /// `Last-Modified` header, defined in
#[doc="[RFC7232](http://tools.ietf.org/html/rfc7232#section-2.2)"] /// [RFC7232](http://tools.ietf.org/html/rfc7232#section-2.2)
#[doc=""] ///
#[doc="The `Last-Modified` header field in a response provides a timestamp"] /// The `Last-Modified` header field in a response provides a timestamp
#[doc="indicating the date and time at which the origin server believes the"] /// indicating the date and time at which the origin server believes the
#[doc="selected representation was last modified, as determined at the"] /// selected representation was last modified, as determined at the
#[doc="conclusion of handling the request."] /// conclusion of handling the request.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Expires = HTTP-date"] /// Expires = HTTP-date
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `Sat, 29 Oct 1994 19:43:31 GMT`"] /// * `Sat, 29 Oct 1994 19:43:31 GMT`
#[doc=""] ///
#[doc="# Example"] /// # Example
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# extern crate time;"] /// # extern crate time;
#[doc="# fn main() {"] /// # fn main() {
#[doc="// extern crate time;"] /// // extern crate time;
#[doc=""] ///
#[doc="use hyper::header::{Headers, LastModified, HttpDate};"] /// use hyper::header::{Headers, LastModified, HttpDate};
#[doc="use time::{self, Duration};"] /// use time::{self, Duration};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(LastModified(HttpDate(time::now() - Duration::days(1))));"] /// headers.set(LastModified(HttpDate(time::now() - Duration::days(1))));
#[doc="# }"] /// # }
#[doc="```"] /// ```
(LastModified, "Last-Modified") => [HttpDate] (LastModified, "Last-Modified") => [HttpDate]
test_last_modified { test_last_modified {

View File

@@ -1,34 +1,34 @@
header! { header! {
#[doc="`Location` header, defined in"] /// `Location` header, defined in
#[doc="[RFC7231](http://tools.ietf.org/html/rfc7231#section-7.1.2)"] /// [RFC7231](http://tools.ietf.org/html/rfc7231#section-7.1.2)
#[doc=""] ///
#[doc="The `Location` header field is used in some responses to refer to a"] /// The `Location` header field is used in some responses to refer to a
#[doc="specific resource in relation to the response. The type of"] /// specific resource in relation to the response. The type of
#[doc="relationship is defined by the combination of request method and"] /// relationship is defined by the combination of request method and
#[doc="status code semantics."] /// status code semantics.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Location = URI-reference"] /// Location = URI-reference
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `/People.html#tim`"] /// * `/People.html#tim`
#[doc="* `http://www.example.net/index.html`"] /// * `http://www.example.net/index.html`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Location};"] /// use hyper::header::{Headers, Location};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(Location(\"/People.html#tim\".to_owned()));"] /// headers.set(Location("/People.html#tim".to_owned()));
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Location};"] /// use hyper::header::{Headers, Location};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(Location(\"http://www.example.com/index.html\".to_owned()));"] /// headers.set(Location("http://www.example.com/index.html".to_owned()));
#[doc="```"] /// ```
// TODO: Use URL // TODO: Use URL
(Location, "Location") => [String] (Location, "Location") => [String]

View File

@@ -1,34 +1,34 @@
header! { header! {
#[doc="`Referer` header, defined in"] /// `Referer` header, defined in
#[doc="[RFC7231](http://tools.ietf.org/html/rfc7231#section-5.5.2)"] /// [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.5.2)
#[doc=""] ///
#[doc="The `Referer` [sic] header field allows the user agent to specify a"] /// The `Referer` [sic] header field allows the user agent to specify a
#[doc="URI reference for the resource from which the target URI was obtained"] /// URI reference for the resource from which the target URI was obtained
#[doc="(i.e., the \"referrer\", though the field name is misspelled). A user"] /// (i.e., the "referrer", though the field name is misspelled). A user
#[doc="agent MUST NOT include the fragment and userinfo components of the"] /// agent MUST NOT include the fragment and userinfo components of the
#[doc="URI reference, if any, when generating the Referer field value."] /// URI reference, if any, when generating the Referer field value.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Referer = absolute-URI / partial-URI"] /// Referer = absolute-URI / partial-URI
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `http://www.example.org/hypertext/Overview.html`"] /// * `http://www.example.org/hypertext/Overview.html`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Referer};"] /// use hyper::header::{Headers, Referer};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(Referer(\"/People.html#tim\".to_owned()));"] /// headers.set(Referer("/People.html#tim".to_owned()));
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Referer};"] /// use hyper::header::{Headers, Referer};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(Referer(\"http://www.example.com/index.html\".to_owned()));"] /// headers.set(Referer("http://www.example.com/index.html".to_owned()));
#[doc="```"] /// ```
// TODO Use URL // TODO Use URL
(Referer, "Referer") => [String] (Referer, "Referer") => [String]

View File

@@ -1,29 +1,29 @@
header! { header! {
#[doc="`Server` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-7.4.2)"] /// `Server` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-7.4.2)
#[doc=""] ///
#[doc="The `Server` header field contains information about the software"] /// The `Server` header field contains information about the software
#[doc="used by the origin server to handle the request, which is often used"] /// used by the origin server to handle the request, which is often used
#[doc="by clients to help identify the scope of reported interoperability"] /// by clients to help identify the scope of reported interoperability
#[doc="problems, to work around or tailor requests to avoid particular"] /// problems, to work around or tailor requests to avoid particular
#[doc="server limitations, and for analytics regarding server or operating"] /// server limitations, and for analytics regarding server or operating
#[doc="system use. An origin server MAY generate a Server field in its"] /// system use. An origin server MAY generate a Server field in its
#[doc="responses."] /// responses.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Server = product *( RWS ( product / comment ) )"] /// Server = product *( RWS ( product / comment ) )
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `CERN/3.0 libwww/2.17`"] /// * `CERN/3.0 libwww/2.17`
#[doc=""] ///
#[doc="# Example"] /// # Example
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Server};"] /// use hyper::header::{Headers, Server};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(Server(\"hyper/0.5.2\".to_owned()));"] /// headers.set(Server("hyper/0.5.2".to_owned()));
#[doc="```"] /// ```
// TODO: Maybe parse as defined in the spec? // TODO: Maybe parse as defined in the spec?
(Server, "Server") => [String] (Server, "Server") => [String]

View File

@@ -1,34 +1,34 @@
use header::Encoding; use header::Encoding;
header! { header! {
#[doc="`Transfer-Encoding` header, defined in"] /// `Transfer-Encoding` header, defined in
#[doc="[RFC7230](http://tools.ietf.org/html/rfc7230#section-3.3.1)"] /// [RFC7230](http://tools.ietf.org/html/rfc7230#section-3.3.1)
#[doc=""] ///
#[doc="The `Transfer-Encoding` header field lists the transfer coding names"] /// The `Transfer-Encoding` header field lists the transfer coding names
#[doc="corresponding to the sequence of transfer codings that have been (or"] /// corresponding to the sequence of transfer codings that have been (or
#[doc="will be) applied to the payload body in order to form the message"] /// will be) applied to the payload body in order to form the message
#[doc="body."] /// body.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Transfer-Encoding = 1#transfer-coding"] /// Transfer-Encoding = 1#transfer-coding
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `gzip, chunked`"] /// * `gzip, chunked`
#[doc=""] ///
#[doc="# Example"] /// # Example
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, TransferEncoding, Encoding};"] /// use hyper::header::{Headers, TransferEncoding, Encoding};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" TransferEncoding(vec!["] /// TransferEncoding(vec![
#[doc=" Encoding::Gzip,"] /// Encoding::Gzip,
#[doc=" Encoding::Chunked,"] /// Encoding::Chunked,
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
(TransferEncoding, "Transfer-Encoding") => (Encoding)+ (TransferEncoding, "Transfer-Encoding") => (Encoding)+
transfer_encoding { transfer_encoding {

View File

@@ -3,51 +3,51 @@ use std::str::FromStr;
use unicase::UniCase; use unicase::UniCase;
header! { header! {
#[doc="`Upgrade` header, defined in [RFC7230](http://tools.ietf.org/html/rfc7230#section-6.7)"] /// `Upgrade` header, defined in [RFC7230](http://tools.ietf.org/html/rfc7230#section-6.7)
#[doc=""] ///
#[doc="The `Upgrade` header field is intended to provide a simple mechanism"] /// The `Upgrade` header field is intended to provide a simple mechanism
#[doc="for transitioning from HTTP/1.1 to some other protocol on the same"] /// for transitioning from HTTP/1.1 to some other protocol on the same
#[doc="connection. A client MAY send a list of protocols in the Upgrade"] /// connection. A client MAY send a list of protocols in the Upgrade
#[doc="header field of a request to invite the server to switch to one or"] /// header field of a request to invite the server to switch to one or
#[doc="more of those protocols, in order of descending preference, before"] /// more of those protocols, in order of descending preference, before
#[doc="sending the final response. A server MAY ignore a received Upgrade"] /// sending the final response. A server MAY ignore a received Upgrade
#[doc="header field if it wishes to continue using the current protocol on"] /// header field if it wishes to continue using the current protocol on
#[doc="that connection. Upgrade cannot be used to insist on a protocol"] /// that connection. Upgrade cannot be used to insist on a protocol
#[doc="change."] /// change.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Upgrade = 1#protocol"] /// Upgrade = 1#protocol
#[doc=""] ///
#[doc="protocol = protocol-name [\"/\" protocol-version]"] /// protocol = protocol-name ["/" protocol-version]
#[doc="protocol-name = token"] /// protocol-name = token
#[doc="protocol-version = token"] /// protocol-version = token
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11`"] /// * `HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11`
#[doc=""] ///
#[doc="# Examples"] /// # Examples
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Upgrade, Protocol, ProtocolName};"] /// use hyper::header::{Headers, Upgrade, Protocol, ProtocolName};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(Upgrade(vec![Protocol::new(ProtocolName::WebSocket, None)]));"] /// headers.set(Upgrade(vec![Protocol::new(ProtocolName::WebSocket, None)]));
#[doc="```"] /// ```
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Upgrade, Protocol, ProtocolName};"] /// use hyper::header::{Headers, Upgrade, Protocol, ProtocolName};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" Upgrade(vec!["] /// Upgrade(vec![
#[doc=" Protocol::new(ProtocolName::Http, Some(\"2.0\".to_owned())),"] /// Protocol::new(ProtocolName::Http, Some("2.0".to_owned())),
#[doc=" Protocol::new(ProtocolName::Unregistered(\"SHTTP\".to_owned()),"] /// Protocol::new(ProtocolName::Unregistered("SHTTP".to_owned()),
#[doc=" Some(\"1.3\".to_owned())),"] /// Some("1.3".to_owned())),
#[doc=" Protocol::new(ProtocolName::Unregistered(\"IRC\".to_owned()),"] /// Protocol::new(ProtocolName::Unregistered("IRC".to_owned()),
#[doc=" Some(\"6.9\".to_owned())),"] /// Some("6.9".to_owned())),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="```"] /// ```
(Upgrade, "Upgrade") => (Protocol)+ (Upgrade, "Upgrade") => (Protocol)+
test_upgrade { test_upgrade {

View File

@@ -1,36 +1,36 @@
header! { header! {
#[doc="`User-Agent` header, defined in"] /// `User-Agent` header, defined in
#[doc="[RFC7231](http://tools.ietf.org/html/rfc7231#section-5.5.3)"] /// [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.5.3)
#[doc=""] ///
#[doc="The `User-Agent` header field contains information about the user"] /// The `User-Agent` header field contains information about the user
#[doc="agent originating the request, which is often used by servers to help"] /// agent originating the request, which is often used by servers to help
#[doc="identify the scope of reported interoperability problems, to work"] /// identify the scope of reported interoperability problems, to work
#[doc="around or tailor responses to avoid particular user agent"] /// around or tailor responses to avoid particular user agent
#[doc="limitations, and for analytics regarding browser or operating system"] /// limitations, and for analytics regarding browser or operating system
#[doc="use. A user agent SHOULD send a User-Agent field in each request"] /// use. A user agent SHOULD send a User-Agent field in each request
#[doc="unless specifically configured not to do so."] /// unless specifically configured not to do so.
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="User-Agent = product *( RWS ( product / comment ) )"] /// User-Agent = product *( RWS ( product / comment ) )
#[doc="product = token [\"/\" product-version]"] /// product = token ["/" product-version]
#[doc="product-version = token"] /// product-version = token
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `CERN-LineMode/2.15 libwww/2.17b3`"] /// * `CERN-LineMode/2.15 libwww/2.17b3`
#[doc="* `Bunnies`"] /// * `Bunnies`
#[doc=""] ///
#[doc="# Notes"] /// # Notes
#[doc="* The parser does not split the value"] /// * The parser does not split the value
#[doc=""] ///
#[doc="# Example"] /// # Example
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, UserAgent};"] /// use hyper::header::{Headers, UserAgent};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(UserAgent(\"hyper/0.5.2\".to_owned()));"] /// headers.set(UserAgent("hyper/0.5.2".to_owned()));
#[doc="```"] /// ```
(UserAgent, "User-Agent") => [String] (UserAgent, "User-Agent") => [String]
test_user_agent { test_user_agent {

View File

@@ -1,50 +1,50 @@
use unicase::UniCase; use unicase::UniCase;
header! { header! {
#[doc="`Vary` header, defined in [RFC7231](https://tools.ietf.org/html/rfc7231#section-7.1.4)"] /// `Vary` header, defined in [RFC7231](https://tools.ietf.org/html/rfc7231#section-7.1.4)
#[doc=""] ///
#[doc="The \"Vary\" header field in a response describes what parts of a"] /// The "Vary" header field in a response describes what parts of a
#[doc="request message, aside from the method, Host header field, and"] /// request message, aside from the method, Host header field, and
#[doc="request target, might influence the origin server's process for"] /// request target, might influence the origin server's process for
#[doc="selecting and representing this response. The value consists of"] /// selecting and representing this response. The value consists of
#[doc="either a single asterisk (\"*\") or a list of header field names"] /// either a single asterisk ("*") or a list of header field names
#[doc="(case-insensitive)."] /// (case-insensitive).
#[doc=""] ///
#[doc="# ABNF"] /// # ABNF
#[doc="```plain"] /// ```plain
#[doc="Vary = \"*\" / 1#field-name"] /// Vary = "*" / 1#field-name
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example values"] /// # Example values
#[doc="* `accept-encoding, accept-language`"] /// * `accept-encoding, accept-language`
#[doc=""] ///
#[doc="# Example"] /// # Example
#[doc="```"] /// ```
#[doc="use hyper::header::{Headers, Vary};"] /// use hyper::header::{Headers, Vary};
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set(Vary::Any);"] /// headers.set(Vary::Any);
#[doc="```"] /// ```
#[doc=""] ///
#[doc="# Example"] /// # Example
#[doc="```"] /// ```
#[doc="# extern crate hyper;"] /// # extern crate hyper;
#[doc="# extern crate unicase;"] /// # extern crate unicase;
#[doc="# fn main() {"] /// # fn main() {
#[doc="// extern crate unicase;"] /// // extern crate unicase;
#[doc=""] ///
#[doc="use hyper::header::{Headers, Vary};"] /// use hyper::header::{Headers, Vary};
#[doc="use unicase::UniCase;"] /// use unicase::UniCase;
#[doc=""] ///
#[doc="let mut headers = Headers::new();"] /// let mut headers = Headers::new();
#[doc="headers.set("] /// headers.set(
#[doc=" Vary::Items(vec!["] /// Vary::Items(vec![
#[doc=" UniCase(\"accept-encoding\".to_owned()),"] /// UniCase("accept-encoding".to_owned()),
#[doc=" UniCase(\"accept-language\".to_owned()),"] /// UniCase("accept-language".to_owned()),
#[doc=" ])"] /// ])
#[doc=");"] /// );
#[doc="# }"] /// # }
#[doc="```"] /// ```
(Vary, "Vary") => {Any / (UniCase<String>)+} (Vary, "Vary") => {Any / (UniCase<String>)+}
test_vary { test_vary {