Expand description
§Cataclysm: A simple http framework
Cataclysm is a small personal project, an http framework influenced by actix-web
, and built over tokio
. A minimal working example is the following
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();
}
Modules§
- http
- Contains the specific functionality for http interaction
- session
- Contains usefull stuff for session management
- ws
ws
- Contains some basic websockets functionality
Structs§
- Additional
- Wrapper for additional shared data in the server
- Branch
- Main cataclysm structure for route handling
- Cors
- Inner cors structure
- Cors
Builder - Cors builder structure
- Server
- Http Server instance
- Server
Builder - Builder pattern for the server structure
- Shared
- Wrapper around data to be shared in the server
- Stream
- Wrapper around a TCP Stream
Enums§
- Error
- Errors returned by this library
- Pipeline
- Pipeline type, contains either a layer or the core of the pipeline
Traits§
- Callback
- Callback trait, for http callbacks
- Extractor
- Extractor trait
- Stream
Callback stream
- StreamCallback trait, similar to a normal http callback but receives the TcpStream