Rust
https://doc.rust-lang.org/book/
Module
It's dangerous to go alone, pub
mod
use
this.rs
When you use mod in your crate root (
src/main.rs
), it references a file in the same directory (i.e.src/<name>.rs
).
When you use mod in a non-root file (like
src/joke.rs
), it references a file in a directory with that name (i.e.src/joke/<name>.rs
).
Putting a
mod.rs
file in the directory you want to expose