rustdoc Questions

3

Solved

I've just started playing with Rust and was trying to generate docs for the code I've written. When I issued cargo doc, I saw something a little weird. 21:53 $ cargo doc Compiling regex-syntax v0...
Casualty asked 11/12, 2015 at 2:59

0

I've come across a case where I have a generic that needs to satisfy two traits. pub struct FileReader<R: Read + Seek> { /* private fields */ } These are standard traits and I can find their...
Jarman asked 17/9, 2022 at 5:26

2

Solved

If you look at the Tokio docs on docs.rs there's a blue tag indicating that a feature must be activated in order to access this API: I would like to enable this for my crate as well, how can this ...
Franke asked 24/4, 2020 at 21:6

1

Solved

According to doc.rust-lang.org cargo rustdoc build[s] a package's documentation, using specified custom flags cargo doc build[s] a package's documentation What is the difference between the...
Ekg asked 11/1, 2022 at 20:35

1

In another question of mine, I asked how to publicly expose only a concrete variant (Foo<u32>) of a private generic type (Foo<T>). The suggested solution is as follows: mod internal { ...
Becoming asked 4/12, 2021 at 15:23

2

I've used conditional compilation to change the type signature of a function, and now the same doctest can't be run for both "feature" modes, so I need a way to opt-out of the doctests. I've tried...
Ahn asked 10/7, 2016 at 14:5

3

Solved

rustdoc allows you to document struct fields and enum variants by including a doc comment above each line: enum Choices { /// The first choice. First, /// The second choice. Second, } struct ...
Rata asked 3/5, 2015 at 2:34

1

Solved

Is there any way to generate a single markdown file in doc/ from the /// comments? Multiple markdown files (doc/main.md, doc/foo.md, etc) would be nice too. I'm new to rust, and while the generat...
Methadone asked 3/12, 2019 at 4:48

2

Solved

As of Rust 1.6.0, the generated documentation hides the implementation of each macro pattern: Is there a way to hide some of the patterns from the Cargo-generated docs? macro_rules! mc { // h...
Phlegmy asked 21/2, 2016 at 15:7

5

Solved

I'm building a Rust library and want to give it some polish. In the rustdoc, I'd sometimes like to link to other parts of the library within the docs, e.g. fns, traits or structs. What is the offic...
Wideawake asked 23/7, 2015 at 8:30

3

Solved

This section of the Rust book seems to imply that it is possible to keep Rust documentation in separate .md files, but it does not say how these .md files can then be included back. How does this w...
Millikan asked 26/2, 2018 at 0:45

1

If the readme Cargo.toml key is set, doc.rs renders the README on the crate's index page. Is there a way to emulate this when running cargo doc locally? If I add: #![doc = r###"contents of ...
Bearnard asked 8/8, 2019 at 22:36

2

Solved

I want to document my crate and include a table in the documentation: //! Demonstrating MarkDown tables. //! //! | Foo | Bar | Baz | Qux | //! | --- | --- | --- | --- | //! | Hail the turbofish `:...
Canvasback asked 24/3, 2019 at 14:35

1

Solved

I have a project with: main.rs module_1/mod.rs module_2/mod.rs module_2/module_3/mod.rs when I run cargo doc, I have just documentation for main.rs, not for modules. In my main.rs I have: mod ...
Clump asked 2/9, 2018 at 10:52

2

Solved

How can I write a line into the documenation code but let the compiler ignore it? I want to write /// # Examples /// /// To clone something, do /// /// ``` /// IGNORE_FOR_COMPILATION_BUT_SHOW: le...
Slovene asked 20/2, 2017 at 15:12

1

Solved

How should Markdown be used with rustdoc to include diagrams or ASCII art? From reading the manual, triple back-ticks can be used for code-snippets. How do I include literal, non-formatted text? ...
Poteet asked 11/11, 2016 at 15:0

2

Solved

I'm trying to write docs for a project I'm writing in Rust. One of the docs requires using regex::Regex. Here's the doc I'm trying to write: /// Return a list of the offsets of the tokens in `s`, ...
Tallinn asked 19/12, 2015 at 15:36

2

Solved

I'm having difficulty fixing an error inside my documentation example for my library. I have the file structure like for my crate bignum . |-- Cargo.lock |-- Cargo.toml |-- examples | |-- dat | | ...
Auxochrome asked 26/7, 2015 at 14:43

1

Solved

I'd like to view the rust docs for a library that my program depends on. How can I pull these down? I found a question with the answer for the standard library but I'm looking specifically for crat...
Actaeon asked 6/7, 2015 at 12:23
1

© 2022 - 2024 — McMap. All rights reserved.