3 unstable releases

0.2.1 Sep 9, 2024
0.2.0 May 3, 2023
0.1.1 Apr 7, 2023
0.1.0 Apr 6, 2023

#242 in HTTP server

Download history 37/week @ 2024-07-27 3/week @ 2024-08-03 59/week @ 2024-08-10 1/week @ 2024-08-17 5/week @ 2024-08-24 25/week @ 2024-08-31 159/week @ 2024-09-07 92/week @ 2024-09-14 29/week @ 2024-09-21 28/week @ 2024-09-28 76/week @ 2024-10-05 18/week @ 2024-10-12 95/week @ 2024-10-19 20/week @ 2024-10-26 23/week @ 2024-11-02 31/week @ 2024-11-09

174 downloads per month

MIT/Apache

410KB
1K SLoC

Meteoritus

A tus server integration for Rocket framework.

Getting started:

Meteoritus is a Fairing that implements tus protocol on top of Rocket framework, so in order to use it you'll need the following dependencies in Cargo.toml:

Current version v0.2.0 See changelog

[dependencies]
rocket = "0.5.0-rc.2"
meteoritus = "0.2.0"

Then attach Meteoritus to your Rocket server on launch:

#[macro_use] extern crate rocket;
use rocket::data::ByteUnit;
use meteoritus::Meteoritus;

#[get("/")]
fn hello() -> &'static str {
    "Hello, world!"
}

#[launch]
fn rocket() -> _ {
let meteoritus = Meteoritus::new()
        .mount_to("/api/files")
        .with_temp_path("./tmp/uploads")
        .with_max_size(ByteUnit::Gibibyte(1))
          .on_creation(|ctx| {
                println!("on_creation: {:?}", ctx);
                Ok(())
           })
          .on_created(|ctx| {
                println!("on_created: {:?}", ctx);
           })
          .on_completed(|ctx| {
               println!("on_completed: {:?}", ctx);
           })
          .on_termination(|ctx| {
               println!("on_termination: {:?}", ctx);
           })
        .build();
    
    rocket::build()
        .attach(meteoritus)
        .mount("/", routes![hello])
}

For more detailed information check out the complete Api documentation.

Dependencies

~16–50MB
~803K SLoC