pub enum ContentRange {
    Bytes(ContentRangeBytes),
    UnboundBytes(ContentRangeUnbound),
    Unsatisfied(ContentRangeUnsatisfied),
    Unknown,
}
Expand description

HTTP Content-Range response header representation.

Variants

Bytes(ContentRangeBytes)

Regular bytes range response with status 206

UnboundBytes(ContentRangeUnbound)

Regular bytes range response with status 206

Unsatisfied(ContentRangeUnsatisfied)

Server response with status 416

Unknown

Header cannot be parsed. This includes non-standard response with status 206

Implementations

Parses Content-Range HTTP header string as per RFC 7233.

header is the HTTP Content-Range header (e.g. bytes 0-9/30).

This parser is a bit more lenient than the official RFC, it allows spaces and tabs between everything. See https://httpwg.org/specs/rfc7233.html#rfc.section.4.2

Same as [parse] but parses directly from the byte array

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.