
Public API Design for Rust Crates That Survive Releases
Decide what is public on purpose: small surface, private fields, builders, non_exhaustive types and re-exports. Check for accidental breakage with cargo-semver-checks.
Everything you need to level up your coding skills.

Decide what is public on purpose: small surface, private fields, builders, non_exhaustive types and re-exports. Check for accidental breakage with cargo-semver-checks.

SQLx runs your SQL, Diesel builds queries in Rust's type system and SeaORM is an async ORM on top of SQLx. Compare them on the work you actually do and pick one.

Fuzz a Rust function with cargo-fuzz and libFuzzer: init, write a target, run, read crashes, minimize inputs, add a corpus and turn findings into regression tests.

Organize Rust tests in a large workspace: unit tests beside code, integration tests per crate, a shared test-support crate, slow test gating and what to run in CI.

Read stdin as lines, bytes or all at once, handle empty input, detect pipes versus terminals, and avoid loading huge streams into memory.

Handle SIGTERM and Ctrl C so Axum finishes in-flight requests before exiting. Includes the signal future, the drain timeout and the Kubernetes and systemd details.

Tokio spawn needs a Send future. When the compiler says the future cannot be sent between threads safely, it points at the value held across an await.

A repository hides the database behind a trait. See when that helps (testing, swapping stores) and when it only adds indirection, with a concrete trait, an SQLx impl and an in-memory fake.

E0308 mismatched types means the compiler expected one type and found another. Learn the five shapes it takes, from a missing semicolon to if branches that differ.

Implement soft deletes and audit trails in a Rust app: deleted_at columns, query defaults, partial unique indexes, history tables with triggers and privacy limits.

E0597 means a reference outlives the value it points to. See the two common shapes, a block that ends too early and a struct that outlives its data, and how to fix each.

Design a database schema that matches your Rust types: NOT NULL and Option, enums, newtype ids, timestamps, money as integers and constraints that back up the compiler.
We send one email when a new post is published. No spam.