The Standard Library
Rust's Standard Library, stdlib, contains all primitive types, basic modules, and macros. In fact, nearly all of this book talks about it, with Chapter 11, Exploring the Standard Library filling in some gaps.
It is the well-tested and minimal code that ensures portability to a wide diversity of platforms and on which is built the rest of the ecosystem.
Having installed Rust also means that you have a binary version of the Standard Library on your system. When you compile source code or do a cargo build, this stdlib is included; this explains why the executable file size is not that small (for example 129 KB for welcomec.exe on Windows).
Compile with rustc -C prefer-dynamic welcome.rs to get a small executable, like 10 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access