Struct hyper::header::AcceptRanges [] [src]

pub struct AcceptRanges(pub Vec<RangeUnit>);

Accept-Ranges header, defined in RFC7233

The Accept-Ranges header field allows a server to indicate that it supports range requests for the target resource.

ABNF

Accept-Ranges     = acceptable-ranges
acceptable-ranges = 1#range-unit / \"none\"

# Example values
* `bytes`
* `none`
* `unknown-unit`

Examples

use hyper::header::{Headers, AcceptRanges, RangeUnit};

let mut headers = Headers::new();
headers.set(AcceptRanges(vec![RangeUnit::Bytes]));
use hyper::header::{Headers, AcceptRanges, RangeUnit};

let mut headers = Headers::new();
headers.set(AcceptRanges(vec![RangeUnit::None]));
use hyper::header::{Headers, AcceptRanges, RangeUnit};

let mut headers = Headers::new();
headers.set(
    AcceptRanges(vec![
        RangeUnit::Unregistered("nibbles".to_owned()),
        RangeUnit::Bytes,
        RangeUnit::Unregistered("doublets".to_owned()),
        RangeUnit::Unregistered("quadlets".to_owned()),
    ])
);