Meteoritus

docs.rs Crates.io Rocket Homepage [![Crates.io](https://img.shields.io/crates/d/meteoritus)](https://crates.io/crates/meteoritus) [![Crates.io](https://img.shields.io/crates/l/meteoritus)](https://crates.io/crates/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:

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

Then attach Meteoritus to your Rocket server on launch:

```rust

[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() .mountto("/api/files") .withtemppath("./tmp/uploads") .withmaxsize(ByteUnit::Gibibyte(1)) .oncreation(|ctx| { println!("oncreation: {:?}", ctx); Ok(()) }) .oncreated(|ctx| { println!("oncreated: {:?}", ctx); }) .oncompleted(|ctx| { println!("on_completed: {:?}", ctx); }) .build(); rocket::build() .attach(meteoritus) .mount("/", routes![hello]) } ```

For more detailed information check out the complete Api documentation.