ByteRangeSpec
is one range-spec of a Range header in the bytes unit
(RFC 9110 §14.1.1): FirstLast for 0-499, From for 500- — everything from
byte 500 to the end — and Suffix for -500, the last 500 bytes.
bound
(Fn [(Ref String a)] (Maybe Long))
(bound s)
parses one decimal byte position — a first-pos, last-pos or
suffix-length — as (Maybe Long). A digit run too large for a Long
saturates at Long.MAX instead of wrapping, so an absurd bound stays an
out-of-range bound. Nothing when s is empty or holds anything but digits.
delete
(Fn [ByteRangeSpec] ())
deletes a ByteRangeSpec. This should usually not be called manually.
str
(Fn [(Ref ByteRangeSpec a)] String)
(str s)
serializes one spec back into its range-spec form: 0-499, 500-
or -500. Anything ByteRange.parse produced reads
back into an equal spec; bounds are written as given, so a hand-built negative
one writes a range-spec that parser rejects.