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
//! # Cataclysm: A simple http framework
//!
//! Cataclysm is a small personal project, an http framework influenced by [`actix-web`](https://actix.rs/), and built over [`tokio`](https://tokio.rs/). A minimal working example is the following
//! 
//! ```rust,no_run
//! extern crate cataclysm;
//! 
//! use cataclysm::{Server, Branch, http::{Response, Method}};
//! 
//! async fn index() -> Response {
//!     Response::ok().body("Hello, World!")
//! }
//! 
//! #[tokio::main]
//! async fn main() {
//!     let server = Server::builder(
//!         Branch::<()>::new("/").with(Method::Get.to(index))
//!     ).build().unwrap();
//! 
//!     server.run("localhost:8000").await.unwrap();
//! }
//! ```

pub use self::error::Error;
mod error;
pub use self::branch::{Branch};
mod branch;

/// Contains the specific functionality for http interaction
pub mod http;

pub use self::server::{Server, ServerBuilder};
mod server;
pub use self::shared::{Shared};
mod shared;
pub use self::additional::Additional;
mod additional;
pub use self::cors::{CorsBuilder, Cors};
mod cors;

pub use self::metafunctions::{Callback, CoreFn, LayerFn, Pipeline, Extractor};
#[cfg(feature = "ws")]
pub(crate) use self::metafunctions::{WebSocketFn};
#[cfg(feature = "demon")]
pub(crate) use self::metafunctions::{WebSocketDemonFn};
mod metafunctions;

pub use self::session::Session;
mod session;

/// Contains some basic websockets functionality
#[cfg(feature = "ws")]
pub mod ws;