Git Product home page Git Product logo

rust-http-range's Introduction

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

rust-http-range's People

Contributors

bancek avatar nyurik avatar quasicomputational avatar rawler avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

rust-http-range's Issues

Parsing response's content ranges

Hi, it seems there is no other rust code for parsing ranges, but you only handle the request header's structure, not the response (which is slightly different). Would you be ok to add that to your lib? Eventually I do hope the reqwest lib will support it directly (I created a ticket there), but noone has replied yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.