Symbol visibility

  1. pub fn public_function() {
  2. }
  3. fn private_function() {
  4. }

Functions are private (not exported) by default. To allow other modules to use them, prepend pub. The same applies to constants and types.

Note: pub can only be used from a named module. For information about creating a module, see Modules.