pub enum Topology {
Bin,
Mod,
}Expand description
How the split file sits in the module tree — fixes the sibling path prefix
and where sub-module files go. Re-export visibility is per part in both
topologies: pub use when the part has a public item (preserving the
crate’s public API), else no wider than the part’s items need.
Variants§
Bin
A binary or library crate root (main.rs, lib.rs): siblings reached
via crate::, moved private items raised to pub(crate) and
re-exported pub(crate) use, fn main (if any) kept at the root.
Mod
A nested library module (foo/mod.rs, or a plain foo.rs file module):
sub-modules reached via super::, moved private items raised only to
pub(super), and each module re-exported with a single glob — pub use
to preserve a public API, pub(crate) use for crate-visible items, else
a private use. A plain foo.rs file module resolves mod bar; to
foo/bar.rs, so its sub-modules are written into a foo/ subdir.