The Rust core library
The Rust core library provides runtime features required by the language, including the task scheduler and memory allocators, as well as library support for Rust built-in types, platform abstractions, and other commonly used features.
core
includes modules corresponding to each of the integer types, each of the floating point types, the bool
type, tuples, characters, strings, vectors (vec
), managed boxes (managed
), owned boxes (owned
), and unsafe and borrowed pointers (ptr
). Additionally, core
provides task management and creation (task
), communication primitives (comm
and pipes
), an efficient vector builder (dvec
), platform abstractions (os
and path
), basic I/O abstractions (io
), common traits (cmp
, num
, to_str
), and complete bindings to the C standard library (libc
).
core
is linked to all crates by default and its contents imported. Implicitly, all crates behave as if they included the following prologue:
extern mod core;
use core::*;
debug
- The debug log levelerror
- The error log levelinfo
- The info log levelwarn
- The warning log levelat_vec
- Managed vectorsbool
- Boolean logiccast
- Unsafe operationschar
- Utilities for manipulating the char typeclone
condition
dlist
- A doubly-linked listdlist_iter
dvec
- Dynamic vectordvec_iter
either
- A type that represents one of two alternativesextfmt
- Support for fmt! expressions.f32
- Operations and constants for f32
f64
- Operations and constants for f64
flate
- Simple compressionfloat
- Operations and constants for float
from_str
- The trait for types that can be created from stringsgc
- Precise garbage collectorhash
- Implementation of SipHash 2-4i16
- Operations and constants for i16
i32
- Operations and constants for i32
i64
- Operations and constants for i64
i8
- Operations and constants for i8
int
- Operations and constants for int
io
- Basic input/outputiter
- The iteration traits and common implementationlibc
- Bindings for libc.logging
- Loggingmanaged
- Operations on managed box typesmutable
- Module for wrapping freezable data structures in managed boxesnil
- Functions for the unit type.num
- An interface for numeric typesoldcomm
- Deprecated communication between tasksoption
- Operations on the ubiquitous Option
type.option_iter
os
- Higher-level interfaces to libc::* functions and operating system services.owned
- Operations on unique pointer typespath
- Cross-platform file path handlingpipes
- Runtime support for message passing with protocol enforcement.ptr
- Unsafe pointer utility functionsrand
- Random number generationreflect
- Runtime type reflectionrepr
- More runtime type reflectionresult
- A type representing either success or failurerun
- Process spawningsend_map
- Sendable hash mapsstr
- String manipulationsys
- Misc low level stufftask
- Task management.to_bytes
- The ToBytes
and IterBytes
traitsto_str
- The ToStr
trait for converting to stringstuple
- Operations on tuplesu16
- Operations and constants for u16
u32
- Operations and constants for u32
u64
- Operations and constants for u64
u8
- Operations and constants for u8
uint
- Operations and constants for uint
util
- Miscellaneous helpers for common patterns.vec
- Vectorsdebug
u32
The debug log level
error
u32
The error log level
info
u32
The info log level
warn
u32
The warning log level