Expand description
§Chopin
A thread-per-core HTTP framework for Rust with zero async overhead.
Chopin uses a shared-nothing architecture: each worker thread owns its own
epoll/kqueue event loop, socket accept, router clone, and connection pool.
There are no Arc, no Mutex, and no async runtimes.
§Quick Start
use chopin_core::{get, Context, Response, Chopin};
#[get("/")]
fn index(_ctx: Context) -> Response {
Response::text("Hello, world!")
}
fn main() {
Chopin::new()
.mount_all_routes()
.serve("0.0.0.0:8080")
.unwrap();
}Re-exports§
pub use error::ChopinError;pub use error::ChopinResult;pub use extract::FromRequest;pub use extract::Json;pub use extract::Query;pub use headers::Header;pub use headers::HeaderValue;pub use headers::Headers;pub use headers::IntoHeaderValue;pub use http::Body;pub use http::Context;pub use http::Method;pub use http::OwnedFd;pub use http::Request;pub use http::Response;pub use router::RouteDef;pub use router::Router;pub use server::Chopin;pub use server::Server;pub use inventory;
Modules§
- conn
- error
- extract
- Request extractors for typed data parsing.
- headers
- http
- http2
- http_
date - HTTP utilities for RFC 7231 compliant operations and common HTTP helpers.
- json
- metrics
- multipart
- openapi
- parser
- router
- server
- slab
- syscalls
- timer
- websocket
- worker