- Date: November 16, 2015
- Subject: Designing APIs, and using packages ("crates") and modules
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.
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.
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.
- Chris Patti
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.
Demonstrates that modules can be
Demonstrates the use of modules and namespaces.