Module show_notes::e006
source · Expand description
Modularize this!
- Date: November 16, 2015
- Subject: Designing APIs, and using packages (“crates”) and modules
- Audio
§Notes
Today, we are talking about modules, packages, and APIs in Rust. Taking a bit of a breather after some pretty hard material the last few weeks.
For reference, the Rust book section on Crates and Modules will be very helpful.
§Corrigenda
I accidentally called this episode 5, instead of episode 6. Whoops.
Just before the 15:00 mark, while discussing libraries, I referred to “e006.md” when I meant to say “e006.rs”. Slips of the tongue inspired by the fact that Rust (delightfully) uses Markdown for its documentation.
§Links
§Module Docs!
As you’ve no doubt noted if you’ve actually looked at the show notes along
the way, these are in fact module docs! Because we’re inside a module marked
off by being a file, we have to use the //!
style of documentation
comments to mark them off. However, as you’ll see below, if we structure or
declare modules in other ways, we will not have the same restriction.
§Sponsors
- reddraggone9
- Chris Patti
§Become a sponsor
§Follow
- New Rustacean:
- Twitter: @newrustacean
- App.net: @newrustacean
- Email: hello@newrustacean.com
- Twitter: @newrustacean
- Chris Krycho
- Twitter: @chriskrycho
- App.net: @chriskrycho
- Twitter: @chriskrycho
Modules§
- Give an example of nested modules.
- This is an internal module. Note that it isn’t public.
- This is an internal module which is public.
Functions§
- Demonstrates that modules can be
use
d within functions. - Demonstrates the use of modules and namespaces.