Module show_notes::e006 [] [src]

Modularize this!

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

Become a sponsor

Follow

Modules

demonstrate_namespacing
demonstrate_nesting

Give an example of nested modules.

public_internal_module

This is an internal module which is public.

Functions

demonstrate_use_inside_function

Demonstrates that modules can be used within functions.

use_modules_internal

Demonstrates the use of modules and namespaces.