Closed zjp-CN closed 8 months ago
├── [Mod] actix::prelude
│ ... (non-module items omitted under prelude module)
│ ├─➤ [Mod] actors
│ ├── [Mod] dev
│ ... (non-module items omitted under dev module)
│ │ ├─➤ [Mod] actix::dev::channel
│ │ └── [Mod] prelude
│ │ ├─➤ [Mod] actors
│ │ ├─➤ [Mod] fut
│ │ ╰─➤ [Mod] io
│ ├─➤ [Mod] fut
│ ╰─➤ [Mod] io
vs HTML version
//Module actix::prelude
pub use crate::actors;
pub use crate::dev;
pub use crate::fut;
pub use crate::io;
//Module actix::dev
pub use crate::prelude::*;
pub mod channel { ... }
This is a follow-up to #2 .
Background
actix contains infinite recursive modules:
The HTML rendering version show them as the source code does:
But the rendering is imperfect as tree view because a complete tree always is cached as known lines.
Even though the syntax of
use actix::prelude::dev::prelude
is acceptable in Rust and for human, it's definitely not encouraged to use. (Well, it might serve as an odd macro trick.)So to solve the problem of stack overflows, there are several ways:
futures
crate is an example for this: it's a highly reexporting crate. Doing so means only two empty modules are shownactix::prelude::dev::prelude
line with extra information that say the path exists and is usable. But the reason to not have it prevails: not encouraged to use for coding, much less important to know for users and simpler code for term-rustdoc.