Skip to main content

Module http_date

Module http_date 

Available on crate features http and std only.
Expand description

RFC 9110 §5.6.7 HTTP-dates as unix seconds.

Formats IMF-fixdate (Sun, 06 Nov 1994 08:49:37 GMT) and parses it plus the two obsolete forms a recipient must accept: RFC 850 (Sunday, 06-Nov-94 08:49:37 GMT) and asctime (Sun Nov 6 08:49:37 1994).

Constants§

HTTP_DATE_LEN
Byte length of every IMF-fixdate.
MAX_HTTP_DATE_UNIX_SECS
Fri, 31 Dec 9999 23:59:59 GMT, the last second an HTTP-date can represent.

Functions§

format_http_date
Format unix_secs as an IMF-fixdate; values past MAX_HTTP_DATE_UNIX_SECS clamp to it.
format_http_date_bytes
Same as format_http_date but returned as owned Bytes.
format_http_date_bytes_maybe_now
format_http_date_bytes, sharing the bytes of format_http_date_now_bytes when unix_secs is the second those were last formatted for on this thread.
format_http_date_now
format_http_date for the current second of rama’s cached wall clock.
format_http_date_now_bytes
format_http_date_now as shared bytes, formatted once per second per thread.
parse_http_date
Unix seconds of an IMF-fixdate, RFC 850 or asctime HTTP-date, ignoring surrounding OWS.