Skip to content

Api Design practice problems in Rust

Difficulty:
Category & tags Filters active
Category:
Tag:

Showing 18 of 18

Title Difficulty
Associated type or generic parameter? Hard
Cargo features and the additivity rule Hard
Choose parameter types and shrink an enum Medium
Cow in API design: impl Into<Cow<str>> Hard
Define a structured validation error Medium
Designing safe wrappers around unsafe FFI Hard
Documenting failure: # Errors and # Panics Medium
Model public item paths and re-exports Hard
#[must_use] in depth Medium
Protect rectangle invariants with private fields Easy
Result, and why it is #[must_use] Easy
SemVer for Rust APIs: what actually breaks Hard
&str not &String, &[T] not &Vec<T>: deref coercion and ptr_arg Easy
The wildcard trap: _ arms freeze your enum against the future Medium
Two inputs, one output lifetime Medium
Type-driven design: newtypes, smart constructors, builders, typestate Hard
Unsound API smells: two fixes and a review checklist Medium
What a &mut parameter actually promises Medium