0

Do you know how to make cargo doc document nicely what features are required for some code to be included / work? Much like this example from tokio:

enter image description here

How should I annotate my code? What arguments should I pass to cargo? I want to include documentation like this in my own crate, but all attempts I made failed.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
GrayCat
  • 1,749
  • 3
  • 19
  • 30
  • Tokio is open source, which means you can [look to see how they implemented it](https://github.com/tokio-rs/tokio/blob/tokio-0.2.22/tokio/src/macros/cfg.rs#L228-L236). – Shepmaster Aug 25 '20 at 20:47
  • Tokio is also quite complex project and I spent some time looking it up, but I didn't know what to look for exactly. Thank you regardless. – GrayCat Aug 25 '20 at 21:52

0 Answers0