Module webmachine_rust::content_negotiation

source ·
Expand description

The content_negotiation module deals with handling media types, languages, charsets and encodings as per https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.

Structs§

Enums§

Functions§

  • Determines if the charsets produced by the resource matches the acceptable charsets provided by the client. Returns the match if there is one.
  • Determines if the media types produced by the resource matches the acceptable media types provided by the client. Returns the match if there is one.
  • Determines if the encodings supported by the resource matches the acceptable encodings provided by the client. Returns the match if there is one.
  • Determines if the languages produced by the resource matches the acceptable languages provided by the client. Returns the match if there is one.
  • Sorts the list of encodings by weighting as per https://tools.ietf.org/html/rfc2616#section-14.3. Note that identity encoding is awlays added with a weight of 1 if not already present.
  • Sorts the list of charsets by weighting as per https://tools.ietf.org/html/rfc2616#section-14.2. Note that ISO-8859-1 is added as a default with a weighting of 1 if not all ready supplied.
  • Sorts the list of media types by weighting
  • Sorts the list of media types by their weights