How to Create an Internal (Private) Module in Rust

Create a private Rust module by defining it without the `pub` keyword to restrict access to its internal functions.

To create an internal (private) module in Rust, define the module without the pub keyword and keep its items private by omitting pub from them.

mod internal_utils {
    fn helper() {
        // This function is only accessible within this module
    }

    pub fn public_helper() {
        // This is accessible outside the module
    }
}

// internal_utils::helper() would fail here
internal_utils::public_helper(); // This works

By default, modules and their contents are private to the parent module unless explicitly marked pub.