"The Rust Standard Library is the foundation of portable Rust software, a set of minimal and battle-tested shared abstractions for the broader Rust ecosystem. It offers core types, like
Vec<T> and
Option<T>, library-defined operations on language primitives, standard macros, I/O and multithreading, among many other things."
Source: https://doc.rust-lang.org/std/
- It depends on system primitives provided by the OS system interface to implement functionality
- It provides a runtime that sets up stack overflow protection, processes command-line arguments, and spawns the main thread.
- RTOS and Embedded OS can support it, but not **bare metal.**
---
## Development with the Core Library
### Subset of the Standard Library
"The Rust Core Library is the dependency-free foundation of The Rust Standard Library. It is the portable glue between the language and its libraries, defining the intrinsic and primitive building blocks of all Rust code. It links to no upstream libraries, no system libraries, and no libc.
The core library is minimal: it isn't even aware of heap allocation, nor does it provide concurrency or I/O. These things require platform integration, and this library is platform-agnostic."
Source: https://doc.rust-lang.org/core/
- Platform Agnostic Subset of Standard Library
- Makes No Assumptions of Underlying System
- Necessary for Bare Metal Implementations
---
## ESP: std vs core
ESP supports both approaches:
- **`esp-idf-hal`** — std approach, relies on ESP-IDF framework (RTOS underneath). Community supported.
- **`esp-hal`** — core (bare metal) approach. Officially supported by Espressif.
---
## Bare Metal Rust