April 2026
Intermediate
631 pages
16h 20m
English
In this section, we’ll explore the concepts of re-exporting and privacy, which play crucial roles in controlling how items are accessed and exposed across modules. Re-exporting allows developers to reorganize and simplify module hierarchies, making external application programming interfaces (APIs) cleaner and more intuitive using the pub use keyword. Additionally, we’ll delve into the privacy rules for structs, explaining how fields can be selectively made public or kept private to encapsulate data effectively.
Let’s demonstrate how the library we’ve created can be used in the main function. To keep things simple, we’ll use the basic version of the library without ...
Read now
Unlock full access