As a program grows past one file, you need structure: a way to group related code and control what's visible where. Rust's answer is the module system — mod, visibility, and use.
mod: grouping code
mod name { ... } declares a module — a named namespace for related items. Modules can nest, and they map naturally onto files: mod foo; tells Rust to load foo.rs (or foo/mod.rs) as that module. You build a tree of modules rooted at your crate.
Visibility: private by default
Everything in Rust is private to its module by default — a function, struct, or field is only visible within the module that defines it (and its children). You opt into visibility with pub: pub fn, pub struct, pub on individual fields. This is the opposite of many languages' default-public, and it's deliberate: you expose your API surface explicitly, so nothing leaks by accident.
pub. This makes the public API a deliberate, visible choice — refactor internals freely, knowing only the pub items are part of your contract with callers.use: bringing paths into scope
use crate::foo::bar brings bar into scope so you can call it unqualified. Paths start from crate (your crate root), self (current module), or super (parent). use is just an import — it doesn't move code, only shortens how you refer to it. Idiomatic Rust groups use statements at the top of each file.