As you begin to write larger and more complex programs, it becomes important to organize your code.
There are a number of features Rust has to help us manage our codes organization and they are packages,
crates, modules and paths.
Packages allow us to build, test and share crates.
Crates are a trio of modules that produces a library or an executable.
Modules.
Let us control the organisation.
Scope and privacy of paths.
And lastly, pass road or a way of naming an item such as a shrunk function or module.
So what does a package?
A package is one or more crates that is going to provide functionality.
Inside a package is a cargo terminal file with instructions on how to build those crates, which every
time we have used cargo new, we have been provided with a cargo Thomas file, which is what I have
displayed here.
And if we had any dependencies in our code, we would be able to see them listed here.
So what does cargo new?
So what cargo new does is creates a new package.
And then inside our directory, we have a cargo file here and also a source directory.
This directory isn't mentioned in the cargo file because cargo follows a convention.
That source slash main dot RS is the crate root of a binary crate and source slash lib rs, which we
will see in the next lecture is going to define a library crate.
The crate allows us to keep related functionality together.
That way is easy for us to use in different projects when we reference the Crates name.
So now let's take a look at modules and let's build out our first library.