How to use pub and visibility

Use the `pub` keyword to make Rust modules, structs, and functions accessible from outside their current scope.

Use the pub keyword to make items like modules, structs, and functions accessible from outside their current scope. By default, items are private to their module; adding pub exposes them to parent modules and other crates.

pub mod config {
    pub fn load() -> String {
        "settings".to_string()
    }
}

fn main() {
    let s = config::load();
}