rust-api-design
Installation
SKILL.md
Rust API Design
Everything pub from the crate root is a promise to every downstream caller. This
skill governs what callers can see and rely on — the exported surface, the shape
of its traits and generics, and which changes break the promise.
The surface is the contract
Default to private and export deliberately: a type pub only because a pub fn
returns it is still part of the API, impls and public fields included. Make
pub(crate) the habit; re-export the surface from lib.rs, module paths private:
// lib.rs
pub use crate::internal::parser::Parser; // the surface
mod internal; // the tree stays private