Embassy is a next-generation embedded framework for Rust that enables asynchronous programming on microcontrollers using async/await syntax. It provides Hardware Abstraction Layers (HALs) for multiple MCU families (STM32, Nordic nRF, Raspberry Pi RP2040/RP23xx, TI MSPM0, NXP MCX-A, etc.), an async executor for cooperative multitasking, timekeeping utilities, networking stack, USB device/host stack, Bluetooth support, bootloader/DFU capabilities, cryptographic primitives, and synchronization primitives. The framework emphasizes safety, correctness, and energy efficiency through Rust's compile-time guarantees, with an executor that automatically enters low-power sleep when idle. Applications are structured around peripheral initialization, async task spawning via #[embassy_executor::task], and event-driven communication using Embassy's synchronization primitives.
axum is a Rust web framework for building HTTP APIs, focusing on ergonomics, modularity, and type safety. It provides a trait-based extractor system for request parsing (FromRequest, FromRequestParts), a composable response system (IntoResponse), and middleware layering via the Tower ecosystem. The framework is built on top of hyper and tokio, offering async request handling with support for WebSockets, Server-Sent Events, file streaming, and more. The architecture is modular, with core traits defined in the `axum-core` crate, additional features (cookies, multipart, typed headers) in `axum-extra`, and proc macros for derive patterns in `axum-macros`. The main entry point is `axum::Router`, which provides methods for routing, nesting, merging, and applying middleware layers. Handlers are async functions that accept extractor arguments (Path, Query, Json, State, etc.) and return any type implementing IntoResponse. The framework emphasizes compile-time safety through macros like `#[derive(FromRequest)]` and `#[derive(TypedPath)]`, and provides debugging aids like `#[debug_handler]` for better type error messages. It includes a rich set of examples demonstrating common patterns such as database integration, authentication, real-time communication, and error handling. External dependencies include tower and tower-http for service abstractions, hyper for HTTP parsing, serde for serialization, and tokio for async runtime. The codebase is actively maintained with a clear versioning strategy, though the main branch contains breaking changes for the upcoming 0.9 release.
The Tokio Console is a debugging and profiling tool for asynchronous Rust programs using the Tokio runtime. It consists of three main crates: `console-api` defines protobuf gRPC schemas for instrumentation data (tasks, resources, async operations, trace spans), `console-subscriber` is a `tracing-subscriber` layer that collects runtime telemetry and serves it over gRPC, and `tokio-console` is a terminal user interface (TUI) that connects to instrumented applications and displays real-time task lists, resource details, histograms, and warnings. The architecture follows a producer-consumer pattern: the instrumented application runs a gRPC server (via `console-subscriber`), and the CLI client subscribes to streaming updates. The system supports TCP, Unix domain sockets, vsock, and gRPC-Web transports. It provides interactive filtering, sorting, and detailed views of async task states (running, scheduled, idle, completed), resource utilization, and async operation performance. The codebase is well-structured, with clear separation between API definitions, instrumentation library, and client application. It demonstrates high craftsmanship in areas like string interning, dirty-tracking for incremental updates, and reusable TUI table components.
mini-redis is an incomplete, idiomatic implementation of a Redis client and server built with Tokio, serving as a teaching resource for asynchronous Rust patterns. The server supports key-value operations (GET, SET) with optional TTL, pub/sub (PUBLISH, SUBSCRIBE, UNSUBSCRIBE), and PING. It demonstrates graceful shutdown, connection limiting via a semaphore, and key expiration using a background task. The client library provides async (Client), blocking (BlockingClient), and buffered (BufferedClient) clients, with a Subscriber type for pub/sub. The codebase is well-structured, extensively commented, and showcases patterns such as frame-level protocol parsing, shared state with std::sync::Mutex, message-passing for multiplexing, and broadcast channels for shutdown signals. It is not intended for production use but is a high-quality reference for learning Tokio and async Rust.