Sized trait and ?Sized for dynamically-sized types

Most types in Rust are Sized (known size at compile time), which is an auto trait. Some types like str or [T] are !Sized (dynamically-sized types, DSTs). To work with DSTs, use &T or Box<T>. In generic code, T: Sized is the default bound. To

color-eyre for beautiful error reports with backtraces

color-eyre enhances eyre (an anyhow alternative) with colored, human-readable error messages and backtraces. It automatically captures panic backtraces and suggestion hints. I use it in CLI tools where error UX matters. The setup is minimal: color_eyr

nom for parser combinators and zero-copy parsing

Nom is a parser combinator library for building parsers from small, composable functions. It's byte-oriented and zero-copy, making it ideal for binary protocols, config files, or log parsing. I define parsers for tokens (like tag("GET") or digit1), th

Parking_lot for faster synchronization primitives

parking_lot provides drop-in replacements for Mutex, RwLock, and Condvar that are faster and smaller than std::sync. They use more efficient parking/unparking and don't poison on panic. I use parking_lot::Mutex in hot paths where lock contention matte

Crossbeam for advanced concurrent data structures

Crossbeam provides lock-free data structures and utilities for concurrent programming. The crossbeam-channel crate offers multi-producer multi-consumer channels with better performance than std::sync::mpsc. crossbeam-utils has scoped threads (borrow d

log crate facade for pluggable logging backends

The log crate provides logging macros (error!, warn!, info!, debug!, trace!) that are backend-agnostic. Libraries use log, and applications choose the backend (env_logger, simple_logger, or tracing). This decouples logging from the implementation. I u

panic! and unwinding for unrecoverable errors

Rust panics are for bugs, not expected errors. When code panics (via panic!, unwrap(), expect(), or assertion failure), the thread unwinds by default, running destructors. I use panic! for invariant violations or \"this should never happen\" cases. Fo

PhantomData for zero-cost type-level markers

PhantomData<T> is a zero-sized type that acts as if it owns T for the purposes of lifetimes, variance, and drop check. I use it in the typestate pattern or when a struct logically depends on T but doesn't store it. For example, a handle to an ex

Send and Sync traits for safe concurrency guarantees

Send means a type can be transferred across thread boundaries. Sync means a type can be shared between threads (&T is Send). Most types are Send + Sync; exceptions include Rc (not Send) and RefCell (not Sync). The compiler uses these marker traits

wasm-bindgen for Rust to JavaScript interop in WebAssembly

Wasm-bindgen generates JavaScript bindings for Rust code compiled to WebAssembly. Annotate functions with #[wasm_bindgen], and the tool generates JS glue code. I use it to write performance-critical browser code in Rust: parsers, crypto, data processi

Inline assembly for critical performance hotspots

Rust's inline assembly (asm! macro) lets you write assembly for performance-critical code or to access hardware features. It's an unstable feature (nightly only) and requires unsafe. I use it sparingly for SIMD intrinsics not exposed by std::arch, cry

cfg attribute for conditional compilation

The #[cfg(...)] attribute enables conditional compilation based on features, target OS, or build profiles. I use #[cfg(test)] for test-only code, #[cfg(target_os = \"linux\")] for platform-specific logic, and #[cfg(feature = \"...\")] for optional fea