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
//! Contraband is a web framework for building modular applications in Rust with dependency
//! injection and performant higher-level abstractions. It is build on top of
//! [`actix-web`](https://crates.io/crates/actix-web).
//!
//! Contraband is heavily inspired by Spring Boot and Nestjs.
//!
//! ## Example
//!
//! ```rust,no_run
//! use contraband::{Injectable, controller, module};
//! use contraband::core::ContrabandApp;
//! use actix_web::HttpResponse;
//!
//! #[derive(Clone, Injectable)]
//! struct HelloController;
//!
//! #[controller]
//! impl HelloController {
//! #[get]
//! async fn hello_world(self) -> HttpResponse {
//! HttpResponse::Ok().body("Hello world!")
//! }
//! }
//!
//! #[module]
//! #[controller(HelloController)]
//! struct HelloModule;
//!
//! #[contraband::main]
//! async fn main() -> std::io::Result<()> {
//! ContrabandApp::new()
//! .start::<HelloModule>()
//! .await
//! }
//! ```
//!
//! ## Documentation & community resources
//!
//! * [GitHub repository](https://github.com/styren/contraband)
//! * [Examples](https://github.com/styren/contraband/tree/master/examples)
extern crate actix_rt;
extern crate contraband_codegen;
pub use System as Runtime;
pub use *;