Sguaba is a Rust library that provides hard-to-misuse rigid body transforms (spatial math) for engineers. It enforces coordinate system safety at the type level using PhantomData and unsafe declarations, preventing accidental mixing of coordinate frames (e.g., NED vs FRD vs ENU). The library supports common Earth-bound systems (WGS84, ECEF) and local systems (NED, FRD, ENU), and provides both a mathematical API (Rotation, RigidBodyTransform) and an engineering-focused API (Orientation, Pose). It includes fast and extended algorithms for ECEF-WGS84 conversion based on recent research. The code is well-structured, thoroughly tested, and supports no_std environments via a libm feature. Active development with semantic versioning, comprehensive CI, and dependency management.
Crossbeam is a Rust library workspace providing a comprehensive set of concurrent programming primitives. It includes multi-producer multi-consumer (MPMC) channels with a select! macro for multiplexing, work-stealing deques (Chase-Lev), lock-free queues (bounded ArrayQueue and unbounded SegQueue), epoch-based memory reclamation for safe lock-free memory management, lock-free skip lists (SkipMap/SkipSet), and utilities like cache-padded values, exponential backoff, thread parking, sharded locks, and scoped threads. The library is designed for building high-performance concurrent systems and supports no_std environments. The architecture is modular: each major component lives in its own crate (crossbeam-channel, crossbeam-deque, crossbeam-epoch, crossbeam-queue, crossbeam-skiplist, crossbeam-utils) with a root umbrella crate that re-exports them. The implementations are based on academic literature (Chase-Lev, Michael-Scott, Vyukov queues) and include extensive testing with Miri, Loom model checking, and sanitizers. The codebase demonstrates advanced Rust patterns: unsafe but carefully encapsulated atomic operations, macro_rules-based DSLs, and trait-based abstraction for selectable channels. While primarily a library, the repository also contains benchmarks and examples that serve as both documentation and performance validation. The project is actively maintained with a clear MSRV policy and regular releases. Some components, like the epoch GC and work-stealing deque, are self-contained patterns that could be extracted for use in other concurrent Rust projects.
redb is a high-performance, ACID-compliant embedded key-value store library written in Rust. It provides a B-tree-based storage engine with copy-on-write semantics, MVCC concurrency control, and support for typed tables, multimaps, savepoints (ephemeral and persistent), compaction, and crash recovery. The library exposes a clean public API centered around `Database`, `TableDefinition`, `WriteTransaction`, `ReadTransaction`, and `ReadableTable` traits, with optional derive macros for user-defined key/value types. It is designed for single-writer, multiple-reader access and supports multi-process concurrency via byte-range file locking (experimental). The codebase is extensively tested with integration tests, fuzzing, and benchmarks comparing against LMDB, RocksDB, SQLite, and fjall. Architecturally, redb uses a copy-on-write B+tree for all tables (data, system, freed pages) with a buddy allocator for page management and a region-based file layout. The page store includes a striped LRU read cache, write buffer, and dynamic cache partitioning. Commit strategies range from non-durable (no fsync) to 1PC+C (default) and 2PC (secure). Crash recovery relies on XXH3-128 checksums and optional quick-repair via persistent allocator state. The library is `no_std`-compatible with feature-gated std-dependent parts, and includes a custom spin-lock synchronization module for embedded targets. Key entry points include the `Database::builder()` and `Database::open()` methods, `TableDefinition::new()` for schema definition, and transaction methods like `WriteTransaction::commit()` and `ReadTransaction::open_table()`. The `StorageBackend` trait allows pluggable storage (file, in-memory, custom) and is used extensively in tests for fault injection and crash simulation. External dependencies are minimal (standard library, optional chrono/uuid), with benchmark crates depending on heed, rocksdb, fjall, and rusqlite for comparison. The repository demonstrates strong engineering craftsmanship with clean abstractions, careful handling of edge cases (max keys, large values, corruption), and a well-documented design document (`docs/design.md`). The codebase is actively maintained with a stable file format and backward compatibility guarantees.
smoltcp is a standalone, event-driven TCP/IP network stack designed for bare-metal and real-time embedded systems. It operates without a heap, using compile-time fixed-size buffers and `no_std` Rust. The stack implements a full suite of protocols: Ethernet, ARP, IPv4/IPv6, TCP, UDP, ICMP, DHCPv4, DNS, IGMP/MLD, 6LoWPAN, RPL, and IPsec (AH/ESP). It is structured into modular layers: `wire/` for packet parsing and emission, `iface/` for interface logic (routing, neighbor discovery, fragmentation, multicast), `socket/` for transport and application sockets, `phy/` for hardware abstraction (loopback, raw sockets, TUN/TAP, pcap, fault injection), and `storage/` for reusable data structures (ring buffers, assemblers). The architecture follows a `Packet`/`Repr` pattern for each protocol, enabling zero-copy parsing and emission. The stack is highly configurable via feature flags, allowing minimal builds for constrained devices. It includes extensive unit tests, integration tests (including a network simulator), fuzz targets, and benchmarks. The codebase demonstrates strong engineering practices with RFC compliance, pluggable congestion control (Reno, Cubic), and async support via waker registration. It is primarily a library for use in embedded projects, IoT devices, and any environment requiring a lightweight, reliable network stack without an operating system.
This is the primary Rust geospatial geometry library (`georust/geo`), providing foundational data types (`Point`, `LineString`, `Polygon`, etc.) via `geo-types` and a comprehensive suite of computational geometry algorithms via the `geo` crate. The library implements OGC Simple Feature Access predicates (`Contains`, `Intersects`, `Covers`, `Within`), DE-9IM topological relationships (`Relate`), boolean operations (union, intersection, difference), convex/concave hulls, triangulation (ear-cutting, constrained Delaunay), simplification (Ramer-Douglas-Peucker, Visvalingam-Whyatt), distance calculations across multiple metric spaces (Euclidean, Haversine, Geodesic, Rhumb), spatial indexing (R-tree, ball tree, interval tree), clustering (DBSCAN, k-means), outlier detection (LOF), polygon repair, and validation. It is a library, not an applicationβno binary entry points, only examples and benchmarks. The codebase is characterized by a trait-oriented design, heavy use of macros to reduce boilerplate, generic numeric types (`GeoFloat`, `GeoNum`), and a metric-space abstraction that allows algorithms to be reused across coordinate systems. It has extensive test coverage including a JTS (Java Topology Suite) conformance test runner, fuzz testing, and criterion benchmarks. The architecture is modular with clear separation between types, traits, algorithms, and testing infrastructure. While generally well-maintained, some legacy modules (`old_sweep`) and deprecated traits exist, and the boolean operations depend on an external `i_overlay` crate.
rcgen is a Rust library for X.509 certificate generation, part of the rustls ecosystem. It provides a programmatic API to create self-signed certificates, CA-signed certificates, certificate signing requests (CSRs), and certificate revocation lists (CRLs) with full RFC 5280 compliance. The library supports multiple cryptographic backends (ring, aws-lc-rs), a wide range of signature algorithms (ECDSA, Ed25519, RSA, ML-DSA), and extensible extension handling. It is architected around traits like `SigningKey` and `PublicKeyData` for key abstraction, and uses `yasna` for DER encoding and `pki-types` for standard PKI types. The repository also includes a CLI tool `rustls-cert-gen` for quick certificate generation, and a verification test suite that validates generated certificates against OpenSSL, Botan, and webpki. The codebase demonstrates strong adherence to RFCs, careful error handling, and modular design.
Ockam is a framework for building secure, interconnected systems that provides identity-based end-to-end encrypted communication, secure channel establishment, and policy-based access control. The architecture features clear separation of concerns with modules for core types, identity management, secure channels, transport abstractions, vault cryptography, API orchestration, and a command-line interface. Implemented primarily in Rust with Elixir components, it uses async/await and OTP patterns for concurrency. Key entry points include the ockam CLI, node builder/context, and orchestrator API. The system enables secure multi-hop routing, message forwarding, and service integration with external systems like Kafka and InfluxDB.
The RustSec monorepo is a multi-crate workspace that provides the official security audit toolchain for the Rust ecosystem. Its flagship product is `cargo-audit`, a CLI subcommand for Cargo that scans `Cargo.lock` files against the RustSec Advisory Database to detect known vulnerabilities, unmaintained or unsound crates, and yanked packages. The workspace also includes the `rustsec` core library for managing the advisory database (fetched via git, indexed, and queried), `cargo-lock` for parsing and manipulating Cargo.lock files (supporting V1 through V4 format), `cvss` for parsing and scoring CVSS vectors (v2.0, v3.x, v4.0), `platforms` for programmatic access to Rust target triples, and `admin` for maintaining the advisory database and generating the rustsec.org website. Although primarily an application and library toolset, the repository has data-oriented aspects: the advisory database is a curated set of Markdown files with TOML front matter, and `platforms` is auto-generated from rustc target information. The architecture is modular, with each crate independently usable and well-tested, and CI pipelines ensure cross-platform releases and static analysis.
grex is a regular expression generator that creates regex patterns from user-provided test cases. It implements DFA construction, Hopcroft's minimization algorithm, and Brzozowski's algebraic method to produce Perl-compatible regexes. The system serves dual purposes as a command-line utility and a library with bindings for Rust, Python, and WebAssembly. Key features include Unicode grapheme handling, configurable character class conversions (digits/whitespace/word), case insensitivity, repetition detection, and syntax highlighting. The architecture separates core regex building logic from CLI, Python, and WASM extension points, enabling reuse across multiple contexts.
This is a Rust library that provides safe, idiomatic bindings over the C library librdkafka, enabling Rust applications to produce and consume messages from Apache Kafka. The architecture is a thin wrapper: it exposes a high-level typed API (producers, consumers, admin client, transactions) while delegating all network I/O, partition management, and protocol handling to librdkafka. Key entry points include `ClientConfig` for building clients, the `Consumer` and `Producer` traits, and concrete implementations (`BaseConsumer`, `StreamConsumer`, `BaseProducer`, `FutureProducer`, `ThreadedProducer`). Data flows through a polling loop that dispatches events (delivery reports, rebalance notifications, log messages) to user-provided `ClientContext` callbacks. External dependencies are the librdkafka native library (bundled via submodule or system) and optional async runtimes (Tokio, smol, async-std). The library is heavily used in production Rust Kafka deployments.
MMTk (Memory Management Toolkit) is a high-performance, portable garbage collection framework written in Rust. It provides a library of reusable GC algorithms (plans) including generational, concurrent, mark-sweep, immix, reference-counting (LXR), and mark-compact variants. The system exposes a trait-based VM binding interface (VMBinding) that language runtimes implement to integrate MMTk as their garbage collector. The architecture is modular: a parallel work-stealing scheduler dispatches GC work packets, policy spaces encapsulate memory allocation strategies (bump, free-list, immix, large object, etc.), and a flexible metadata system supports both header-resident and side metadata. The crate is not a standalone application; it is consumed as an rlib by VM bindings such as OpenJDK, JikesRVM, V8, Julia, and Ruby. Extensive use of procedural macros (HasSpaces, PlanTraceObject) reduces boilerplate for adding new GC plans. The codebase includes performance tracing tools (eBPF, Perfetto) and a comprehensive test suite with mock VM support.
Argh is an opinionated derive-based argument parsing library for Rust, optimized for code size and conformance to Fuchsia CLI specifications. The repository is a multi-crate workspace: `argh` (public API, re-exports derive macros and provides runtime functions like `from_env`), `argh_derive` (proc-macro implementation of `FromArgs`, `FromArgValue`, and `ArgsInfo`), `argh_shared` (shared data structures for command metadata, used by both derive and completion crates), and `argh_complete` (generators for bash, zsh, fish, and nushell shell completions). The core architecture uses a derive macro to generate parsing code at compile time, producing minimal binary size. It supports switches, options (required, optional, repeating), positional arguments (including greedy/remainder), subcommands (static and dynamic), custom parsers via `FromArgValue`, default values, and extensive help/usage formatting with notes, examples, and error codes. The library is well-tested with unit tests, compile-fail UI tests, and integration tests. It is designed as a lightweight alternative to clap, prioritizing code size and compile-time speed.
imageproc is a Rust library providing a comprehensive suite of image processing operations built on top of the `image` crate. It includes a wide range of filters (Gaussian blur, bilateral, median, sharpen), geometric transformations (rotation, scaling, warping, projection), drawing primitives (lines, shapes, text with font rendering), feature detection (FAST corners, BRIEF descriptors, Hough lines, HoG, Haar-like features), contrast manipulation (histogram equalization, Otsu thresholding), morphology (dilation, erosion, structuring elements), distance transforms, template matching, seam carving, image hashing, and noise addition. The library is designed for performance with extensive use of `unsafe` code where justified, and provides both mutable and immutable API variants, as well as parallel execution via the `rayon` feature. It serves as a practical tool for computer vision and graphics editors, with a focus on correctness and reproducibility (regression tests against reference images). The crate is modular, with each major operation in its own file, and includes many examples demonstrating realistic workflows like edge detection, object matching, and text overlay. While not a research project, it implements classic computer vision algorithms with modern Rust idioms and is actively maintained with regular releases.
aspeak is a text-to-speech client for Azure TTS API, written in Rust. It provides a CLI, a Rust library, and Python bindings. The core functionality synthesizes speech from plain text or SSML using either the REST or WebSocket API. The architecture is modular: the library defines two synthesizer types (`RestSynthesizer` and `WebsocketSynthesizer`) with a unified trait, and a CLI wraps these for command-line use. The Python binding exposes a `SpeechService` class. The codebase demonstrates solid Rust engineering with builder patterns, comprehensive error handling, and support for proxies, custom audio formats, and rich SSML options. It is well-tested with unit and integration tests, has CI/CD pipelines, and is actively maintained.
wl-clipboard-rs is a Rust library providing safe access to the Wayland clipboard through the ext-data-control and wlr-data-control protocols. It consists of a library crate (wl-clipboard-rs) that handles clipboard operations and a tools crate (wl-clipboard-rs-tools) providing terminal utilities: wl-copy (copy to clipboard), wl-paste (paste from clipboard), and wl-clip (xclip-like utility). The library abstracts over different Wayland clipboard protocol versions, manages connections to the compositor, handles MIME type negotiation, and serves clipboard requests. The architecture separates concerns into copy, paste, utils, common connection logic, data control abstraction, and seat data management modules.
This is a mature Rust library for parsing and serializing RSS feeds (versions 0.90 through 2.0). It provides a complete data model for RSS channels, items, categories, enclosures, and other elements, with support for common extensions like iTunes, Dublin Core, Syndication, and Atom. The library uses quick-xml for efficient XML processing and offers optional builder patterns, validation against the RSS 2.0 specification, and serde serialization. The codebase is well-structured, with clear separation of concerns across modules, comprehensive test coverage (including round-trip read/write tests), and active maintenance with regular dependency updates. It is a solid, production-ready library for any Rust project needing RSS feed handling.
This is a Rust library providing an async client for InfluxDB 1.x and 2.x (compatibility mode). It supports writing and reading data via the InfluxDB HTTP API, with a fluent query builder for constructing line protocol write queries and read queries. The library offers optional serde integration for deserializing query results into Rust structs using a custom Serde deserializer that handles InfluxDB's column/value array format. It also includes a derive macro (`InfluxDbWriteable`) for automatically generating write queries from structs. The architecture is centred around a `Client` struct that wraps a `reqwest` HTTP client, with support for authentication (basic auth and token-based) and multiple HTTP backends via feature flags. The codebase is well-structured, with clean separation of concerns, extensive unit and integration tests, and a strong emphasis on correct line protocol escaping. The custom serde deserializer is a notable highlight, demonstrating advanced Serde patterns for transforming array-of-arrays into map-like structures. The project is actively maintained with recent commits and a clear release process.
Microsoft's official Rust framework for developing Windows drivers. The codebase is a multi-crate workspace with clean layering: `wdk-sys` provides raw bindgen-generated FFI bindings to the Windows Driver Kit (WDM/KMDF/UMDF APIs) with feature-gated API subsets (gpio, hid, spb, storage, usb, wdf); `wdk` layers safe idiomatic wrappers on top (no-std formatting buffers, WDF spinlock/timer wrappers, print macros); `wdk-build` powers driver `build.rs` scripts by auto-detecting WDK installations via registry/env vars and emitting compiler flags, linker args, and cfg settings; and `cargo-wdk` is a Cargo extension CLI for scaffolding (`new`), building (`build`), and cleaning (`clean`) driver projects including signing and packaging. Supporting crates `wdk-alloc` and `wdk-panic` provide kernel-mode global allocation (ExAllocatePool2/ExFreePool) and panic handling (KeBugCheckEx/OutputDebugStringA+abort), while `wdk-macros` implements a proc macro for typesafe dispatch of WDF function-table calls. The architecture is a layered library plus CLI toolchain, not a monolith or service; it serves driver developers as both a framework and a build tool. Key entry points are the `cargo wdk` CLI, the `wdk_build::configure_wdk_binary_build()`/`configure_wdk_library_build()` functions invoked from build scripts, and the `wdk` public API. The primary build data flow is: Cargo `[package.metadata.wdk]` manifest metadata β `wdk-build` config β bindgen β generated FFI bindings β driver binary, with WDK/SDK version and install-path detection from registry keys and environment variables. External dependencies include the Windows Driver Kit, LLVM/Clang, bindgen, and Windows packaging/signing tools (signtool, inf2cat, stampinf, certmgr). Engineering quality is genuinely strong: clean crate separation, a testable provider abstraction in the CLI (exec/fs/metadata/wdk_build), secret-redacting command logging, trybuild compile-fail tests, macrotest snapshots pinned per stable/beta/nightly toolchain, emulated-workspace integration tests, and CI spanning multiple WDK/LLVM/Rust versions with CodeQL, cargo-audit, dependabot, and release-plz release automation. Known caveats: the bindgen pipeline is fragile against WDK header changes, a proc-macro cache does not invalidate when source types change, thousands of NTSTATUS constants are manually maintained, LLVM is pinned to 17.0.6 due to an upstream ARM64 bug, and the README explicitly states the project is not yet recommended for production driver use. The repository is Windows-only by domain necessity.
This is a Rust library (`kdl`) for parsing, manipulating, and serializing the KDL Document Language. It provides a fully round-trip-preserving parser (formatting, whitespace, comments) supporting both KDL v2 and, optionally, v1. The library exposes a rich AST (`KdlDocument`, `KdlNode`, `KdlEntry`, `KdlIdentifier`, `KdlValue`) with builder patterns and formatting configuration. It integrates with `serde` for deserializing/serializing Rust types from/to KDL, using a well-documented mapping convention (e.g., `#args`, `#rest`, property renames via `#@`). Error handling is implemented via `miette` for rich diagnostics. The repository also includes a language server (`kdl-lsp`) based on `tower-lsp` that provides diagnostics for KDL files, though incomplete. Comprehensive compliance tests (hundreds of input/expected KDL files) ensure spec adherence. The architecture is a single library crate with optional serde support, a separate v1 fallback crate, and an LSP tool. The core parser uses `winnow` with error recovery. Dead code from a disabled KQL query engine exists, and serde support is marked experimental, indicating some technical drift. Overall, it's a high-quality, professionally engineered library with excellent test coverage and well-thought-out abstractions.
Trussed is a no_std Rust library and framework for building cryptographic firmware on microcontrollers. It implements a client-service syscall architecture: applications use strongly-typed client traits such as CryptoClient, FilesystemClient, and CertificateClient to send Request enums through an interchange channel; Service::process dispatches requests to pluggable mechanism implementations or custom backends, persists keys and files across three littlefs2 filesystems (internal, external, volatile), and returns Reply enums. It is not a standalone application or CLI but an embedded component used by firmware runners such as Solo 2 and Nitrokey 3.