docs.rs failed to build harrow-0.9.4
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Harrow
A thin, macro-free HTTP framework over Hyper with opt-in observability.
Features
- No macros, no magic -- handlers are plain
async fn(Request) -> Responsefunctions. No extractors, no trait bounds, no#[debug_handler]. - Route introspection -- the route table is a first-class data structure you can enumerate at startup for OpenAPI generation, health checks, or monitoring config.
- Opt-in observability -- structured logging, OTLP trace export, and request-id propagation are wired in with one call, powered by rolly.
- Feature-gated middleware -- request-id, CORS, catch-panic, compression, session, rate-limit, and o11y are opt-in via Cargo features. Nothing compiles unless you ask for it.
- Fast -- built directly on Hyper 1.x and matchit routing. No Tower, no
BoxCloneService, no deep type nesting. - Pluggable server backends -- choose between Tokio/Hyper (cross-platform) or Monoio/io_uring (Linux high-performance).
Server Backends (Required)
Harrow requires you to explicitly select an HTTP server backend. There is no default — you must pick exactly one:
| Backend | Feature | Best For | Platform |
|---|---|---|---|
| Tokio + Hyper | tokio |
Cross-platform, development, containers | Linux, macOS, Windows |
| Monoio + io_uring | monoio |
Maximum throughput on Linux 6.1+ | Linux 6.1+ only |
Choosing a Backend
Use Tokio for:
- Cross-platform development (macOS, Windows)
- Container deployments (Docker, ECS Fargate, Lambda)
- When you need TLS support (
tlsfeature) - General-purpose HTTP services
Use Monoio for:
- High-throughput Linux servers (2-3x throughput at 16+ cores)
- Thread-per-core architecture with io_uring
- Bare metal or EC2 deployments with kernel 6.1+
Configuration
# Tokio backend (cross-platform)
[]
= { = "0.9", = ["tokio", "json"] }
= { = "1", = ["full"] } # Required for #[tokio::main] and tokio APIs
# io_uring backend (Linux 6.1+ only)
[]
= { = "0.9", = ["monoio", "json"] }
# Harrow bootstraps monoio worker threads internally via `harrow::runtime::monoio::run(...)`
Explicit Runtime Selection
When both features are enabled (e.g., during development with multiple examples), use the explicit runtime modules:
// Explicit Tokio
use serve;
// Explicit Monoio
use run;
See examples/monoio_hello.rs for a complete Monoio example.
Quickstart
[]
= { = "0.9", = ["tokio"] }
= { = "1", = ["full"] } # Required for #[tokio::main]
use ;
async
async
async
Probes And Error Responses
use ;
use StatusCode;
async
let app = new
.state
.health
.liveness
.readiness_handler
.default_problem_details
.not_found_handler;
Documentation
- Design rationale -- why Harrow exists and what it optimises for
- Explicit extractors philosophy -- the design choice behind plain function signatures
- Performance notes -- benchmark methodology and results
Workspace layout
| Crate | Purpose |
|---|---|
harrow |
Public API -- re-exports core types and feature-gated middleware |
harrow-core |
Request, Response, routing, middleware trait, app builder |
harrow-middleware |
Request-id, CORS, compression, session, rate-limit, o11y |
harrow-o11y |
O11yConfig and rolly integration types |
harrow-server-tokio |
Tokio/Hyper server binding, TLS, graceful shutdown |
harrow-server-monoio |
Monoio/io_uring server for high-performance Linux |
harrow-bench |
Criterion benchmarks and load testing tools |
License
Licensed under the MIT License.