Skip to main content

Module range

Module range 

Source
Expand description

Types for HTTP byte-range requests and responses.

HTTP range requests (RFC 9110 §14.2) allow a client to request a partial transfer of a resource instead of the full content. The client expresses the desired byte range in a Range request header; the server responds with the selected bytes and a Content-Range header that identifies which portion of the object is being returned along with its total size.

This module provides two types that mirror that request/response split:

  • ByteRange — a range request: which bytes the client wants.
  • ContentRange — a range response: which bytes the server is returning, plus the total object size.

Structs§

ContentRange
Byte range returned by the server in a Content-Range response header.

Enums§

ByteRange
Byte range requested by the client via a Range header.
RangeError
Errors that can occur when parsing a Range header.