[src]

Crate std

The Rust standard library

The Rust standard library is a group of interrelated modules defining the core language traits, operations on built-in data types, platform abstractions, the task scheduler, runtime support for language features and other common functionality.

std includes modules corresponding to each of the integer types, each of the floating point types, the bool type, tuples, characters, strings (str), vectors (vec), managed boxes (managed), owned boxes (owned), and unsafe pointers and references (ptr, borrowed). Additionally, std provides pervasive types (option and result), task creation and communication primitives (task, comm), platform abstractions (os and path), basic I/O abstractions (io), common traits (kinds, ops, cmp, num, to_str), and complete bindings to the C standard library (libc).

Standard library injection and the Rust prelude

std is imported at the topmost level of every crate by default, as if the first line of each crate was

extern crate std;

This means that the contents of std can be accessed from any context with the std:: path prefix, as in use std::vec, use std::task::spawn, etc.

Additionally, std contains a prelude module that reexports many of the most common types, traits and functions. The contents of the prelude are imported into every module by default. Implicitly, all modules behave as if they contained the following prologue:

use std::prelude::*;
any

Traits for dynamic typing of any type (through runtime reflection)

ascii

Operations on ASCII strings and characters

bool

Operations on boolean values (bool type)

c_str

C-string manipulation and management

c_vec

Library to interface with chunks of memory allocated in C.

cast

Unsafe casting functions

cell

Types dealing with dynamic mutability

char

Character manipulation (char type, Unicode Scalar Value)

clone

The Clone trait for types that cannot be 'implicitly copied'

cmp

The Ord and Eq comparison traits

comm

Communication primitives for concurrent tasks

container

Traits for generic containers (including Map and Set)

default

The Default trait for types which may have meaningful default values

f32

Operations and constants for 32-bits floats (f32 type)

f64

Operations and constants for 64-bits floats (f64 type)

fmt

Utilities for formatting and printing strings

from_str

The FromStr trait for types that can be created from strings

gc

Task-local garbage-collected boxes

hash

Generic hashing support.

i16

Operations and constants for signed 16-bits integers (i16 type)

i32

Operations and constants for signed 32-bits integers (i32 type)

i64

Operations and constants for signed 64-bits integers (i64 type)

i8

Operations and constants for signed 8-bits integers (i8 type)

int

Operations and constants for architecture-sized signed integers (int type)

intrinsics

rustc compiler intrinsics.

io

I/O, including files, networking, timers, and processes

iter

Composable external iterators

kinds

Primitive traits representing basic 'kinds' of types

libc

Bindings for the C standard library and other platform libraries

local_data

Task local data management

macros

Standard library macros

mem

Basic functions for dealing with memory

num

Numeric traits and functions for generic mathematics

ops

Traits representing built-in operators, useful for overloading

option

Optional values

os

Higher-level interfaces to libc::* functions and operating system services.

owned

Operations on unique pointer types

path

Cross-platform path support

prelude

The standard module imported by default into all Rust modules

ptr

Unsafe pointer utility functions

raw

Contains struct definitions for the layout of compiler built-in types.

rc

Task-local reference-counted boxes (Rc type)

reflect

Runtime type reflection

repr

More runtime type reflection

result

Signaling success or failure states (Result type)

rt

Runtime services, including the task scheduler and I/O dispatcher

slice

Utilities for vector manipulation

str

Unicode string manipulation (str type)

sync

Useful synchronization primitives

task

Utilities for managing and scheduling tasks

to_str

The ToStr trait for converting to strings

tuple

Operations on tuples

ty

Types dealing with unsafe actions.

u16

Operations and constants for unsigned 16-bits integers (u16 type)

u32

Operations and constants for unsigned 32-bits integers (u32 type)

u64

Operations and constants for unsigned 64-bits integer (u64 type)

u8

Operations and constants for unsigned 8-bits integers (u8 type)

uint

Operations and constants for architecture-sized unsigned integers (uint type)

unit

Functions for the unit type.

vec

An owned, growable vector.