# rust-api-guidelines Idiomatic public-API design rules for Rust crates, distilled from the official Rust API Guidelines. ```bash npx rulepack add rust-api-guidelines ``` ## What it covers - **Naming** — RFC 430 casing, `as_`/`to_`/`into_` conversions, getter and iterator conventions, feature/crate naming. - **Common traits & interop** — eager `Debug`/`Clone`/`Eq`/`Ord`/`Hash`/`Default`, `From`/`TryFrom`/`AsRef` conversions, `FromIterator`/`Extend`, Serde, `Send + Sync`. - **Error types** — `std::error::Error` + `Send + Sync`, infallible `Drop`, `# Errors`/`# Panics`/`# Safety` docs. - **Type safety** — newtypes, dedicated types over `bool`/`Option`, `bitflags`, builders, argument validation. - **Future-proofing** — private fields, sealed traits, `#[non_exhaustive]`, not duplicating derived bounds. This is about general idiomatic Rust library design — it complements, rather than duplicates, a web-framework pack like `rust-axum`. ## Source Distilled faithfully from the official Rust API Guidelines: ## License MIT