Use the #[doc(hidden)] attribute above an item to hide it from generated Rust documentation while keeping it accessible in code.
Add the #[doc(hidden)] attribute directly above the item definition to exclude it from generated documentation while keeping it accessible in code.
#[doc(hidden)]
pub fn internal_helper() {
// Implementation remains public for code, hidden from docs
}
This attribute tells rustdoc to skip rendering the item, effectively hiding internal implementation details from users while maintaining the public API for compilation.
The #[doc(hidden)] attribute acts like a 'do not publish' tag for specific code items. It keeps your internal helper functions or implementation details out of the user-facing documentation, preventing confusion while still allowing your code to use them normally. Think of it as keeping the kitchen tools hidden from the dining room menu while the chefs still use them.