libcore for low-level Rust
Rust’s standard library is two-tiered: there’s a small core library,libcore
, and the full standard library, libstd
, that builds on top of it.libcore
is completely platform agnostic, and requires only a handful ofexternal symbols to be defined. Rust’s libstd
builds on top of libcore
,adding support for things like memory allocation and I/O. Applications usingRust in the embedded space, as well as those writing operating systems, ofteneschew libstd
, using only libcore
.
As an additional note, while building libraries with libcore
is supportedtoday, building full applications is not yet stable.
To use libcore
, add this flag to your crate root:
#![no_std]
This will remove the standard library, and bring the core
crate into yournamespace for use:
#![no_std]
use core::cell::Cell;
You can find libcore
's documentation here.