| 1 |
# `no_std` Examples |
| 2 |
|
| 3 |
This folder contains examples for how to work with `no_std` targets and Bevy. |
| 4 |
Refer to each example individually for details around how it works and what features you may need to enable/disable to allow a particular target to work. |
| 5 |
|
| 6 |
## What is `no_std`? |
| 7 |
|
| 8 |
`no_std` is a Rust term for software which doesn't rely on the standard library, [`std`](https://doc.rust-lang.org/stable/std/). |
| 9 |
The typical use for `no_std` is in embedded software, where the device simply doesn't support the standard library. |
| 10 |
For example, a [Raspberry Pi Pico](https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html) has no operating system to support threads or filesystem operations. |
| 11 |
|
| 12 |
For these platforms, Rust has a more fundamental alternative to `std`, [`core`](https://doc.rust-lang.org/stable/core/). |
| 13 |
A large portion of Rust's `std` actually just re-exports items from `core`, such as iterators, `Result`, and `Option`. |
| 14 |
|
| 15 |
In addition, `std` also re-exports from another crate, [`alloc`](https://doc.rust-lang.org/stable/alloc/). |
| 16 |
This crate is similar to `core` in that it's generally available on all platforms. |
| 17 |
Where it differs is that its inclusion requires access to a [global allocator](https://doc.rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html). |
| 18 |
Currently, Bevy relies heavily on allocation, so we consider `alloc` to be just as available, since without it, Bevy will not compile. |