http-range

Crates.iohttp-range
lib.rshttp-range
version0.1.5
sourcesrc
created_at2016-10-02 21:09:55.674671
updated_at2022-02-15 08:34:32.572573
descriptionHTTP Range header parser
homepage
repositoryhttps://github.com/bancek/rust-http-range.git
max_upload_size
id6692
size20,159
Luka Zakrajšek (bancek)

documentation

https://docs.rs/http-range/0.1.5/http_range/

README

rust-http-range

HTTP Range header parser. It parses Range HTTP header string as per RFC 2616.

Inspired by Go's net/http library.

Overview

Example usage:

extern crate http_range;

use http_range::{HttpRange};

fn main() {
    let range_str = "bytes=0-8";
    let size = 10;

    match HttpRange::parse(range_str, size) {
        Ok(rngs) => for r in rngs {
            println!("Start {}, length {}", r.start, r.length)
        },
        Err(err) => println!("HttpRange parse error: {:?}", err)
    };
}

Used in

Author

Luka Zakrajšek

License

MIT

Commit count: 25

cargo fmt