FlClash is a production multi-platform proxy/VPN client that embeds and manages the mihomo (Clash.Meta) Go core. The Dart/Flutter app (Riverpod, Drift, freezed) drives a real core lifecycle: profile/subscription import and validation, proxy group and rule management, TUN/VPN on Android, system proxy on desktop, live connections/requests/DNS views, latency probing, streaming-service availability checks, and WebDAV backup/restore. The Go core exposes a method-dispatch IPC contract (updateConfig, changeProxy, getConnections, watchRoute, probe, serviceCheck, etc.) consumed through an Android cgo bridge and a desktop helper process. This is a full application, not a library or data project — no notebooks, no research pipelines. The architecture is layered: Flutter UI → manager/provider layers → core controller → framed JSON IPC → Go mihomo core. Desktop builds add a Rust privileged helper service (systemd unit / Windows SCM, Unix socket with peer-credential auth) and Rust plugins for global hotkeys, QuickJS evaluation of script-based profile overrides, and a rope-backed code editor (code_forge). Native integration plugins for system tray, window management, system proxy, and WiFi SSID are shipped as separate Dart packages with per-OS implementations in C++/Swift/Kotlin. A custom build-hook system compiles and SHA-256-fingerprints the Go core and Rust helper artifacts with file-locking to make native builds cacheable and idempotent. The codebase is unusually disciplined. Test/ subdirectories include contract tests that parse Go structs from the mihomo submodule to verify DNS-override parity, AST-parsing tests verifying every core method is dispatchable, architectural lint tests (platform layering, dead-file detection, UI tooltip enforcement, Material-icon bans), plus unit and widget tests across every layer. Concurrency is handled deliberately: priority message batching between core and UI, serial task scheduling, claim/cancel semantics for GEO/probe updates, and an Android service state machine with newest-request-wins arbitration. Release tooling generates changelogs from conventional commits and a CI pipeline produces deb/rpm/AppImage/DMG/Inno packages. Caveats: the polyglot stack (Dart, Go, Rust, Kotlin, C++, Swift) and tight coupling to mihomo internals via a git submodule make wholesale extraction impractical, and large amounts of generated code (freezed, riverpod_generator, Drift, flutter_rust_bridge) require coordinated regeneration. Browser-platform and TV branches add conditional complexity, and some UI tests assert precise pixel/animation timings that are brittle. The genuinely reusable value lives in the standalone patterns — IPC framing and batching, the rope data structure, fractional indexing, async utilities, and the fingerprinted build cache — plus the independent plugin packages themselves.
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.
coreaudio-rs is a Rust library providing safe, zero-cost bindings to Apple's CoreAudio API, with particular focus on Audio Unit functionality. The library wraps the complex C API in Rust abstractions that maintain type safety and memory safety while preserving performance. It enables Rust developers to work with audio input/output, audio processing, and hardware interaction on Apple platforms (macOS, iOS, tvOS, visionOS). The architecture follows a modular library design with core functionality in src/, platform-specific helpers in src/audio_unit/macos_helpers.rs, and comprehensive examples demonstrating usage patterns. The library relies on the objc2 crate family for Objective-C interoperability and bitflags for flag management. Data flows involve audio buffers moving between hardware devices and AudioUnit instances through callback mechanisms, with configuration flowing from Rust definitions to the CoreAudio API. Entry points include the main library interface in src/lib.rs, the AudioUnit constructor and methods in src/audio_unit/mod.rs, and platform-specific initialization helpers. The examples directory provides practical demonstrations of audio playback, input/output streaming, and advanced audio unit configuration.