mod defines a code namespace, while use imports items from that namespace into the current scope.
The mod keyword defines a module to organize code into a namespace, while the use keyword brings specific items from that module into the current scope so you can reference them without their full path.
mod my_module {
pub fn helper() { /* ... */ }
}
use my_module::helper;
fn main() {
helper(); // No need to write my_module::helper
}
Think of mod as creating a new folder to organize your files, and use as adding a shortcut on your desktop to access a specific file inside that folder. You use mod to group related code together logically, and you use use to make that code easy to type and read in your main program.