7.1. Packages and Crates

A crate is a binary or library. The crate root is a source file that the Rust compiler starts from and makes up the root module of your crate. A package is one or more crates that provide a set of functionality. A package contains a Cargo.toml file that describes how to build those crates.

7.3. Paths for Referring to an Item in the Module Tree

Modules characteristics:

Privacy of Struct vs Enum

7.4. Bringing Paths Into Scope with the use Keyword

Providing New Names with the as Keyword

One can use as with use like import A as B in Python:

use std::fmt::Result;
use std::io::Result as IoResult;

fn function1() -> Result {
    // --snip--
}

fn function2() -> IoResult<()> {
    // --snip--
}

Re-exporting Names with pub use

Using Nested Paths to Clean Up Large use Lists

Below two use :