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.
Skyzen
A fast, ergonomic HTTP framework for Rust focused on native servers and Cloudflare-compatible edge/serverless platforms.
Features
- Portable core — Write handlers against
Kv,Storage,Queue, andDbinstead of provider SDK types - Stable runtimes today — Native servers and WinterCG/Cloudflare Workers share the same handler model
- Provider extensions — Opt into raw/provider-specific APIs such as
CfD1, queue/scheduled event handlers, and Durable Object capabilities only when you need more than the portable minimum - Extractor/Responder pattern — Type-safe request parsing and response generation via function arguments and return types
- Tree-based routing — Fast, composable routing with path parameters, HTTP method matching, and nested routes
- WebSocket support — Unified WebSocket API across native (async-tungstenite) and WASM (WebSocketPair)
- OpenAPI generation — Automatic API documentation from annotated handlers
#[skyzen::main]— One macro for both native (Tokio + Hyper + logging + graceful shutdown) and WASM (WinterCGfetchexport)- Unified CLI —
skyzen new/dev/deployscaffolds projects, runs native watch/restart, and orchestrates Cloudflare-first deployment flows
Getting Started
[]
= "0.1"
The simplest Skyzen app:
use ;
Run with cargo run and open the address printed in the startup log, or pin a port explicitly with cargo run -- --port 8787.
Extractors & Responders
Pull data from requests with extractors:
use Json;
use Params;
async
Return anything that implements Responder:
async
Routing
Skyzen's routing system is built around Route::new() and intuitive path methods:
use ;
WebSocket
use ;
use WebSocketUpgrade;
new
WebSocket works on both native (via async-tungstenite) and WASM (via WebSocketPair).
Platform Comparison
Portable handlers run against the same capability wrappers. Native and Cloudflare automatic wiring are built in today; AWS and Azure provider crates remain available as infrastructure backends, but runtime parity for those targets is not part of the finished scope.
| Service | Native | Cloudflare | AWS | Azure | Test |
|---|---|---|---|---|---|
| Key-Value | skyzen-redis |
CfKv |
DynamoKv |
CosmosKv |
InMemoryKv |
| Object Storage | skyzen-s3 |
CfR2 |
S3Storage |
AzureBlob |
InMemoryStorage |
| Message Queue | — | CfQueue |
SqsQueue |
ServiceBusQueue |
InMemoryQueue |
| Portable SQL | Db via sqlx |
Db via D1 |
planned wiring | planned wiring | — |
Provider-specific escape hatches remain available when you need more than the portable minimum:
- Cloudflare raw SQL and stateful primitives:
CfD1,DurableKv,DurableDb,Alarm, Durable Objects
See the Services Guide for how to write platform-agnostic handlers and switch between backends. For per-object SQL state that runs on both native and Cloudflare, see the Durable Object + SQL Guide.
Services Abstraction
Skyzen provides portable capability wrappers through skyzen-services. Application code depends on those wrappers, not on provider SDK types:
use ;
async
Wire different backends depending on your deployment target. The wrapper type stays the same:
// Native: Redis + S3
let kv = new;
let storage = new;
// Cloudflare: Workers KV + R2
let kv = new;
let storage = new;
// Testing: In-memory mocks
let kv = new;
let storage = new;
The #[skyzen::main] Macro
For HTTP servers, #[skyzen::main] provides:
- Pretty logging with
tracing(respectsRUST_LOG) - Graceful shutdown on
Ctrl+C - CLI overrides for host/port (
--port,--host,--listen) - Tokio + Hyper runtime configured and ready
Disable the default logger to configure your own:
async
WASM Deployment
For serverless edge platforms, use a lib crate with cdylib:
[]
= ["cdylib", "rlib"]
On WASM targets, #[skyzen::main] exports a WinterCG-compatible fetch handler for Cloudflare Workers, Deno Deploy, and other edge runtimes.
See the Deployment Guide for full setup instructions.
CLI
The skyzen CLI scaffolds projects, runs native watch/restart development, and orchestrates deployment:
Configure platforms via Skyzen.toml. For Cloudflare, Skyzen generates .skyzen/gen/wrangler.toml automatically; users do not hand-maintain wrangler.toml.
Cloudflare Event Handlers
Skyzen also supports Cloudflare-specific queue and scheduled entrypoints:
async
async
For stateful Cloudflare-specific workflows, use #[skyzen::durable_object] with the DurableObject trait.
Custom Server
For advanced scenarios like embedding Skyzen or using a custom runtime:
use ;
use Hyper;
async
OpenAPI Documentation
Generate API docs automatically:
async
Workspace Crates
| Crate | Description | README |
|---|---|---|
skyzen |
Main framework — routing, middleware, extractors, responders, runtime | README |
skyzen-core |
Foundational traits (Extractor, Responder, Server), no_std support |
README |
skyzen-hyper |
Hyper server backend | README |
skyzen-macros |
Procedural macros (#[skyzen::main], #[skyzen::openapi], etc.) |
README |
skyzen-services |
Portable service traits and extractors (Kv, Storage, Queue, Db) |
README |
skyzen-test |
Mock services, TestClient, assertions, snapshot testing |
README |
skyzen-redis |
Redis KeyValueStore implementation |
README |
skyzen-s3 |
S3-compatible ObjectStorage implementation |
README |
skyzen-cloudflare |
Cloudflare Workers implementations (KV, R2, Queues, D1, Durable Objects) | README |
skyzen-aws |
AWS infrastructure backends (DynamoDB, SQS, S3) | README |
skyzen-azure |
Azure infrastructure backends (Cosmos DB, Blob Storage, Service Bus) | README |
skyzen-cli |
Unified CLI for local emulation and deployment | README |
Guides
- Using Portable Services — How to write platform-agnostic handlers and switch backends
- Testing with Skyzen — Mock services, TestClient, assertions, and snapshot testing
- Deploying Skyzen Apps — Native and Cloudflare-first deployment, plus AWS/Azure CLI orchestration notes
- Skyzen.toml Reference — Full configuration reference
License
MIT or Apache-2.0, at your option.