Rust API References

Official API documentation for Rust standard library modules, types, functions, and traits.

Core Library (core)

Foundational functionality available to all Rust code, including types like i32 and Vec.

Primitive Types

  • boolboolean type
  • i88-bit signed int
  • StringHeap-allocated UTF-8 string

Macros

  • concat!Compile-time string concatenation
  • vec!Create a Vec at compile time
  • format!Run-time formatting

Standard Library (std)

Full-featured library built on top of the core library, including std::io and std::thread

Collections

  • VecDynamic array
  • HashMapHash map with ownership safety
  • StringUTF-8 string type

Concurrent Utilities

  • thread::spawnSpawns a new thread
  • sync::MutexSafe shared-state concurrency
  • sync::mpscMultiple-producer single-consumer channels

Language Items

Special traits and definitions that are fundamental to the language.

Traits

  • DropCustom cleanup
  • CloneDeep cloning
  • DerefPointer dereferencing behavior

Operators

  • +Addition operator implementation
  • ==Equality comparison
  • !Logical negation

Common Usage Examples

Memory Safety

// Safe string manipulation
let s = String::from("Hello");
let len = s.len();

// Compile-time ownership checks
let s2 = s;
// s is now invalid - moves only

Concurrent Programming

use std::thread;

thread::spawn(|| {
    println!("Hello from a thread!");
}).join();

Explore the Full API

Search for specific functions, types, or modules using the navigation below:

Collections

Error Handling

Concurrency

Built with the same tools used by the Rust team

GitHub Project