Making a functioning public
The "pub" keyword is used at the starting of the declaration so that the function becomes accessible to the outside functions.
Following are the privacy rules:
Let's understand this through a simple example:
In the above example, the main() function is the root module while an outer module is the current root module of our project. Therefore, the main() function can access the outer module.
The call to outer::a() will not cause any error as the function a() is public, but when the main() function tries to access the outer::b() function, then it causes the compilation error because it is a private function.
The main() function cannot access the inner module as it is private. An inner module has no child module, so it can be accessed only by its parent module, i.e., outer module.