rustdoc tool to generate structured HTML documentation.
Rust supports two syntactic forms for outer documentation comments: line comments and block comments. Both forms natively support Markdown formatting.
Line Comments
Line-based outer documentation comments are denoted by three forward slashes (///). They must be repeated for each line of the comment block.
/** to open the block and */ to close it.
#[doc] attributes. The rustdoc generator operates on these attributes rather than the raw comment syntax.
The following outer comment:
struct, enum, fn, trait, or mod), an associated item, a struct field, or an enum variant.
If an outer documentation comment is placed before an internal function statement (such as a let binding), rustdoc will not process it or generate HTML documentation. Instead, the compiler will emit an unused_doc_comments warning. Standard code comments (//) must be used to document internal statements.
If an outer documentation comment is placed in a location where there is no subsequent construct to attach to at all—such as at the end of a file or at the end of a block scope—the Rust compiler will emit error E0585, indicating a dangling documentation comment.
Tired of Poor Rust Skills? Fix That With Deep Grasping!Learn More





