1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//! # Meteoritus - API Documentation
//!
//! Hello, and welcome to the Meteoritus API documentation!
//!
//! ## Usage
//!
//! 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.1"
//! meteoritus = "0.2.1"
//! ```
//!
//! Then attach [`Meteoritus`] to your [`Rocket`] server on launch:
//!
//! ```rust,no_run
//! #[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])
//! }
//! ```
//! [`Rocket`]: https://api.rocket.rs/v0.5/rocket/index.html
//! [`Fairing`]: https://api.rocket.rs/v0.5/rocket/fairing/index.html
/// These are public dependencies! Update docs if these are changed, especially
/// figment's version number in docs.
extern crate rocket;
use Header;
pub use crateMeteoritus;
pub use crate;
pub use crateHandlerContext;
/// Represents the tus protocol headers.