[][src]Crate rocket_seek_stream

This crate provides a seekable stream responder for rocket that will satisfy range requests.

Examples

see the examples directory for more.

#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate rocket;
use rocket_seek_stream::SeekStream;

#[get("/")]
fn home<'a>() -> std::io::Result<SeekStream<'a>> {
    SeekStream::from_path("kosmodrom.webm")
}
 
fn main() {
    rocket::Rocket::custom(
        rocket::Config::build(rocket::config::Environment::Development)
            .address("localhost")
            .port(8000)
            .finalize()
            .unwrap(),
    )
    .mount("/", routes![home])
   .launch();
}

Structs

SeekStream

Serves a readable and seekable stream, The mime type can optionally be inferred by taking a sample of bytes from the beginning of the stream.

Traits

ReadSeek

Alias trait for Read + Seek