Skip to main content

parse_byte_range

Function parse_byte_range 

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

Parses a single RFC 9110 byte Range header (bytes=start-end, bytes=start-, bytes=-suffix).

§Arguments

  • &str - Raw Range header value.
  • usize - Total resource length in bytes.

§Returns

  • Option<(usize, usize)> - Inclusive (start, end) byte offsets, or None when unsatisfiable/invalid.