Skip to main content

Crate webio

Crate webio 

Source
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.

github crates.io docs.rs license

§🧪 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 std library.
  • Production Warning: Do not use this in a production environment until a stable 1.0.0 version is released.

§🎯 Core Philosophy

The goal of this project is to provide a fully functional async web framework with zero external dependencies.

  • No tokio or async-std.
  • No serde (where possible).
  • No hyper.
  • No bloat.
  • No unsafe code.
  • 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.
StatusCode
Standard HTTP Status Codes. Using a u16 representation ensures compatibility with the HTTP protocol while providing type-safe common codes.

Traits§

BodyStream
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.
IntoBytes
A conversion trait to abstract different types of response data. This allows the .body() method to accept String, &str, or Vec<u8> seamlessly.

Functions§

launch
Launches the WebIo async runtime to drive a Future to completion.

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).