While reading the official book, I stumbled upon packages and crates. To create a new project, this is what I ran:
$ cargo new my-project
Created binary (application) `my-project` package
$ ls my-project
Cargo.toml
src
$ ls my-project/src
main.rs
The book states the following:
A package must contain zero or one library crates, and no more. It can contain as many binary crates as you’d like, but it must contain at least one crate (either library or binary).
My doubt is, what is the difference between library crates and binary crates?
A binary crate is an executable program.
A library crate is a library of reusable components that can be included in another library crate or in a binary crate.