Struct iron::headers::Accept [-] [+] [src]

pub struct Accept(pub Vec<QualityItem<Mime>>);

Accept header, defined in RFC7231

The Accept header field can be used by user agents to specify response media types that are acceptable. Accept header fields can be used to indicate that the request is specifically limited to a small set of desired types, as in the case of a request for an in-line image

ABNF

Accept = #( media-range [ accept-params ] )

media-range    = ( "*/*"
                 / ( type "/" "*" )
                 / ( type "/" subtype )
                 ) *( OWS ";" OWS parameter )
accept-params  = weight *( accept-ext )
accept-ext = OWS ";" OWS token [ "=" ( token / quoted-string ) ]

Example values

Notes

Trait Implementations

impl Deref for Accept

type Target = Vec<QualityItem<Mime>>

fn deref(&'a self) -> &'a Vec<QualityItem<Mime>>

impl DerefMut for Accept

fn deref_mut(&'a mut self) -> &'a mut Vec<QualityItem<Mime>>

impl Header for Accept

fn header_name() -> &'static str

fn parse_header(raw: &[Vec<u8>]) -> Option<Accept>

impl HeaderFormat for Accept

fn fmt_header(&self, f: &mut Formatter) -> Result<(), Error>

impl Display for Accept

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

Derived Implementations

impl PartialEq<Accept> for Accept

fn eq(&self, __arg_0: &Accept) -> bool

fn ne(&self, __arg_0: &Accept) -> bool

impl Debug for Accept

fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>

impl Clone for Accept

fn clone(&self) -> Accept

fn clone_from(&mut self, source: &Self)