Standard Library (v0.2.2)

Standard modules and public APIs for this version.

Latest

The standard library contains the core modules that most Thrust programs use for everyday work: input and output, memory management, math helpers, dynamic arrays, and C bindings. It is intentionally small and explicit, so each module keeps close to the behavior it exposes.

These pages describe what each module provides, how its functions are meant to be used, and which parts map directly to C library behavior. Use this section as the starting point when you need reusable building blocks before writing lower-level bindings yourself.

std::io

Input and output APIs, stream handles, formatted printing, scanning, and file operations.

Open module

std::math

Mathematical constants and wrappers around scalar math functions for f64 and f32.

Open module

std::mem

Allocation, reallocation, memory copy/move/set helpers, and memory mapping constants.

Open module

std::collections::vector

Generic contiguous dynamic array with capacity growth and index-based operations.

Open module

std::tstring

Owned null-terminated strings with byte operations, UTF-8 validation, and Unicode code point helpers.

Open module

std::ffi::c

Type aliases, constants, and C ABI signatures used by standard wrappers.

Open module

std::optional

Optional value container with presence checks and safe access.

Open module

std::env

Process arguments, environment variables, and common system paths.

Open module

std::int

Parsing of signed and unsigned integers from text.

Open module

std::float

Parsing of floating-point values from text.

Open module

std::random

Random numbers and buffer filling.

Open module

std::collections::stack

Last-in first-out container.

Open module

std::collections::queue

First-in first-out container.

Open module

std::collections::vecdeque

Double-ended queue with push and pop on both ends.

Open module

std::collections::hashmap

Hash map from keys to values.

Open module

std::collections::hashset

Hash set of keys.

Open module

std::intrinsics::int

Integer intrinsics: overflow checks, saturation, and bit operations.

Open module

std::intrinsics::float

Floating-point intrinsics: abs, min, max, sqrt, fused multiply-add.

Open module

std::ffi::c::env

Raw C bindings for environment access.

Open module

std::ffi::c::int

Raw C bindings for integer text conversion.

Open module

std::ffi::c::float

Raw C bindings for floating-point text conversion.

Open module

std::ffi::c::random

Raw C bindings for time and random numbers.

Open module

Back to documentation hub