Expand description
§WebIO 🦅
A minimalist, high-performance async web framework for Rust built with a zero-dependency philosophy.
§Why WebIO?
Most Rust web frameworks rely on heavy dependency trees (tokio, hyper, serde). WebIO
explores the power of the Rust std library to provide a fully functional async engine
with a tiny binary footprint and rapid compilation times.
§WebIO 🦅
A minimalist async web framework for Rust with a zero-dependency philosophy.
§🧪 Research Status: Experimental
WebIO is currently in a research and development phase.
- API Stability: Expect significant breaking changes from version to version.
- Goal: To explore the boundaries of high-performance async web servers using only the Rust
stdlibrary. - Production Warning: Do not use this in a production environment until a stable
1.0.0version is released.
§🎯 Core Philosophy
The goal of this project is to provide a fully functional async web framework with zero external dependencies.
- No
tokioorasync-std. - No
serde(where possible). - No
hyper. - No
bloat. - No
unsafecode. - Just pure Rust.
§🛠️ Installation
Add this to your Cargo.toml:
[dependencies]
webio = "0.4.4-alpha"Re-exports§
pub use Method::*;
Structs§
- Params
- Wrapper for URL path parameters (e.g.,
<id>in a route). - Reply
- The outgoing HTTP response.
Uses a
Box<dyn BodyStream>to allow for flexible, memory-efficient body types. - Req
- Represents an incoming HTTP request. Designed for simplicity, containing parsed methods, paths, and headers.
- WebIo
- The central Application controller. Manages routing, middleware, and the internal TCP lifecycle.
Enums§
- Method
- Supported HTTP Methods.
- Status
Code - Standard HTTP Status Codes. Using a
u16representation ensures compatibility with the HTTP protocol while providing type-safe common codes.
Traits§
- Body
Stream - Enables streaming response bodies to support large data transfers without high memory overhead. This is crucial for keeping memory usage low in a zero-dep environment.
- Into
Bytes - A conversion trait to abstract different types of response data.
This allows the
.body()method to acceptString,&str, orVec<u8>seamlessly.
Functions§
Type Aliases§
- BoxFuture
- Type alias for a pinned, thread-safe future. Necessary for handling async route logic without an external runtime.
- Handler
- Represents a route handler. Receives the Request and Path Params, returning an async Response.
- Middleware
- Middleware signature for early-exit logic (e.g., Auth or Logging).