Skip to main content

parse_http_byte_range

Function parse_http_byte_range 

Source
pub fn parse_http_byte_range(
    header: Option<&str>,
    total_len: usize,
) -> ByteRangeSpec
Expand description

Parses an HTTP Range: bytes=start-[end] header against a blob of total_len bytes.

§Arguments

  • Option<&str> - Raw Range header value, if present.
  • usize - Total immutable blob length in bytes.

§Returns

  • ByteRangeSpec - Full, inclusive byte slice, or invalid range indicator.