Struct headers_ext::ContentRange[][src]

pub struct ContentRange { /* fields omitted */ }

Content-Range, described in RFC7233

ABNF

Content-Range       = byte-content-range
                    / other-content-range

byte-content-range  = bytes-unit SP
                      ( byte-range-resp / unsatisfied-range )

byte-range-resp     = byte-range "/" ( complete-length / "*" )
byte-range          = first-byte-pos "-" last-byte-pos
unsatisfied-range   = "*/" complete-length

complete-length     = 1*DIGIT

other-content-range = other-range-unit SP other-range-resp
other-range-resp    = *CHAR

Example

use headers::ContentRange;

// 100 bytes (included byte 199), with a full length of 3,400
let cr = ContentRange::bytes(100, 199, 3400);

Methods

impl ContentRange
[src]

Construct a new Content-Range: bytes .. header.

Note that these byte ranges are inclusive on both ends.

Create a new ContentRange stating the range could not be satisfied.

The passed argument is the complete length of the entity.

Get the byte range if satisified.

Note that these byte ranges are inclusive on both ends.

Get the bytes complete length if available.

Trait Implementations

impl Clone for ContentRange
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for ContentRange
[src]

Formats the value using the given formatter. Read more

impl PartialEq for ContentRange
[src]

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

This method tests for !=.

impl Header for ContentRange
[src]

NAME: &'static HeaderName = &::http::header::CONTENT_RANGE

The name of this header.

Decode this type from a HeaderValue.

Encode this type to a HeaderMap. Read more

Auto Trait Implementations