[src]

Module 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, collections, 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 mod 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::*;

Modules

any

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

ascii

Operations on ASCII strings and characters

at_vec

Operations on managed vectors (@[T] type)

bool

Operations on boolean values (bool type)

borrow

Utilities for references

c_str

C-string manipulation and management

cast

Unsafe casting functions

cell

Types dealing with dynamic mutability

char

Unicode characters manipulation (char type)

clone

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

cmath

Bindings for the C math library (for basic mathematic functions)

cmp

The Ord and Eq comparison traits

comm

Communication primitives for concurrent tasks (Chan and Port types)

condition

Condition handling

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

Implementation of SipHash 2-4

hashmap

Unordered containers, implemented as hash-tables (HashSet and HashMap types)

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)

io

Synchronous I/O

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

logging

Utilities for program-wide and customizable logging

managed

Operations on managed box types

mem

Functions relating to memory layout

num

Numeric traits and functions for generic mathematics

ops

Traits representing built-in operators, useful for overloading

option

Optionally nullable values (Option type)

os

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

path

Cross-platform path support

prelude

The standard module imported by default into all Rust modules

ptr

Unsafe pointer utility functions

rand

Utilities for random number generation

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

run

Utilities for spawning and managing processes

send_str

The SendStr trait for optionally static strings

str

Unicode string manipulation (str type)

sync

Useful synchronization primitives

task

Utilities for managing and scheduling tasks

to_bytes

The ToBytes and IterBytes traits for converting to raw bytes

to_str

The ToStr trait for converting to strings

trie

Ordered containers with integer keys, implemented as radix tries (TrieSet and TrieMap types)

tuple

Operations on tuples

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)

util

Miscellaneous helpers for common patterns

vec

Utilities for vector manipulation