Skip to content

Glossary: Software Design Patterns in Rust

mod

Also written: module, mod tests

The keyword that declares a module. In a multi-file crate, `main.rs` needs a line such as `mod discounts;` for the file `discounts.rs` to count as part of the program.

Where the book teaches it

Related terms

#[cfg(test)]Crate