The Rust Standard Library provides the essential runtime functionality for building portable Rust software. It is linked to all Rust crates by default.
modules deal with unsafe pointers and memory manipulation.
kinds defines the special built-in traits,
raw the runtime representation of Rust types.
These are some of the lowest-level building blocks in Rust.
Although basic operations on primitive types are implemented
directly by the compiler, the standard library additionally
defines many common operations through traits defined in
modules define optional and error-handling types,
iter defines Rust's iterator protocol
along with a wide variety of iterators.
RefCell are for creating types that
manage their own mutability.
The common container type,
Vec, a growable vector backed by an
array, lives in the
vec module. References to
&[T], more commonly called "slices", are built-in types
for which the
slice module defines many
&str, a UTF-8 string, is a built-in type, and the standard library
defines methods for it on a variety of traits in the
str module. Rust strings are immutable;
String type defined in
for a mutable string builder.
Besides basic data types, the standard library is largely concerned
with abstracting over differences in common platforms, most notably
Windows and Unix derivatives. The
provides a number of basic functions for interacting with the
operating environment, including program arguments, environment
variables, and directory navigation. The
module encapsulates the platform-specific rules for dealing
with file paths.
Common types of I/O, including files, TCP, UPD, pipes, Unix domain sockets,
timers, and process spawning, are defined in the
Rust's I/O and concurrency depends on a small runtime interface
that lives, along with its support code, in mod
While a notable part of the standard library's architecture, this
module is not intended for public use.
prelude defines a
common set of traits, types, and functions that are made available
to all code by default.
all the standard macros, such as
format!, also available to all Rust code.
Traits for dynamic typing of any
Operations on ASCII strings and characters
The boolean type
C-string manipulation and management
Library to interface with chunks of memory allocated in C.
Shareable mutable containers.
Character manipulation (
Communication primitives for concurrent tasks
Dynamic library facilities.
Operations and constants for 32-bits floats (
Operations and constants for 64-bits floats (
The Finally trait provides a method,
Utilities for formatting and printing strings
Task-local garbage-collected boxes
Generic hashing support.
Operations and constants for signed 16-bits integers (
Operations and constants for signed 32-bits integers (
Operations and constants for signed 64-bits integers (
Operations and constants for signed 8-bits integers (
Operations and constants for architecture-sized signed integers (
rustc compiler intrinsics.
I/O, including files, networking, timers, and processes
Composable external iterators
Primitive traits representing basic 'kinds' of types
Task local data management
Standard library macros
Basic functions for dealing with memory
Numeric traits and functions for generic mathematics
Higher-level interfaces to libc::* functions and operating system services.
A unique pointer type
Cross-platform path support
The Rust prelude
Operations on unsafe pointers,
Utilities for random number generation
Contains struct definitions for the layout of compiler built-in types.
Task-local reference-counted boxes (
Error handling with the
Runtime services, including the task scheduler and I/O dispatcher
Utilities for vector manipulation
Unicode string manipulation (
An owned, growable string that enforces that its contents are valid UTF-8.
Useful synchronization primitives
Operations on tuples
Types dealing with unsafe actions.
Operations and constants for unsigned 16-bits integers (
Operations and constants for unsigned 32-bits integers (
Operations and constants for unsigned 64-bits integer (
Operations and constants for unsigned 8-bits integers (
Operations and constants for architecture-sized unsigned integers (
An owned, growable vector.