Use
The use keyword is used to bring specific definitions (such as functions, classes, or constants) from another module or namespace into the current scope. This allows you to reference those definitions directly, without needing to prefix them with the module path.
Syntax
Section titled “Syntax”[pub] use module::name [as alias];Example
Section titled “Example”use utils::helpers::do_something as do_something;// same asuse utils::helpers::do_something;
func main() { do_help();}usestatements must appear at the top level of a file, after allimportstatements but before other items.- The path must refer to a valid, public definition in the imported module.