Standard library API
API listing generated from the public items and doc comments of the standard library sources (library/). Behavior and guarantees are defined in the standard library specification.
rok::bare
The lowest layer: pointers, memory, FFI.
rok::barerok::bare - raw pointers, transmute, raw allocation, pinning and volatile access, over the runtime's `extern "rok"` symbols only.rok::bare::allocrok::bare::alloc - raw allocation outside the GC (stdlib spec 1.4).rok::bare::ffirok::bare::ffi - NUL-terminated C strings (stdlib 1.7.2); `wit` is what the WIT bindings run on (1.8).rok::bare::ffi::witrok::bare::ffi::wit - what the generated WIT bindings run on (stdlib 1.8): linear-memory access at canonical ABI addresses (`i32`), the blocks strings and lists lower into, resource handles and `error-context`.rok::bare::gcrok::bare::gc - keeping GC objects in place for raw pointers (stdlib spec 1.6).rok::bare::memrok::bare::mem - raw memory operations, `Pod` and bit casts (stdlib spec 1.2.5 / 1.2.6 / 1.3).rok::bare::mlirrok::bare::mlir - one MLIR op written in rok (stdlib spec 1.9).rok::bare::ptrrok::bare::ptr - raw pointers (stdlib spec 1.1).rok::bare::volatilerok::bare::volatile - accesses the optimizer keeps exactly as written (stdlib spec 1.5): MMIO, signal flags, DMA buffers.
rok::core
Collections, numbers, iterators, formatting, synchronization, tasks. Available to all code automatically.
rok::corerok::core tier (foundation) - safe, target-independent.rok::core::arrayrok::core::array - Clone / Copy / Default / Debug / PartialEq / Eq / Hash for fixed arrays `[T; N]`, element-wise, and PartialOrd / Ord, lexicographic (stdlib 2.5.7, 2.13.6, 2.10.9).rok::core::benchrok::core::bench - the engine `rokc bench` drives (spec 9.9.11).rok::core::channelrok::core::channel - message passing between threads (stdlib spec 2.17).rok::core::cmprok::core::cmp - total equality, ordering and hashing (stdlib spec 2.5).rok::core::collectionsrok::core::collections - List / Dict / Set / OrderedDict / OrderedSet / Slice (stdlib spec 2.9), Deque and BinaryHeap.rok::core::collections::rawrok::core::collections::raw - the GC buffer the collections are built on (stdlib 2.9.12).rok::core::collections::listrok::core::collections::list - `List<T>`, a growable array (stdlib spec 2.9.2): one object holding the length, the capacity and the current element buffer, swapped for a bigger one on growth.rok::core::collections::dequerok::core::collections::deque - `Deque<T>`, a growable ring buffer with O(1) push and pop at both ends.rok::core::collections::heaprok::core::collections::heap - `BinaryHeap<T>`, a priority queue over a `List` laid out as an implicit binary tree.rok::core::collections::dictrok::core::collections::dict - `Dict<K, V>`, a hash map (stdlib spec 2.9.3), compact: entries are appended to dense key / value / hash arrays, and a power-of-two index of linear-probed slots maps a hash to its entry.rok::core::collections::setrok::core::collections::set - `Set<T>`, a hash set (stdlib spec 2.9.4) over `Dict<T, bool>`.rok::core::collections::ordered_dictrok::core::collections::ordered_dict - `OrderedDict<K, V>`, a hash map that iterates in insertion order (stdlib spec 2.9.5): a `Dict`, whose compact entries already keep that order.rok::core::collections::ordered_setrok::core::collections::ordered_set - `OrderedSet<T>`, a hash set that iterates in insertion order (stdlib spec 2.9.5), over `OrderedDict<T, bool>`.rok::core::collections::slicerok::core::collections::slice: `Slice<T>`, a zero-copy view (stdlib 2.9.7); element `i` is `buf[start + i * stride]`, and the view keeps its buffer alive.rok::core::collections::broadcastrok::core::collections::broadcast - the element-wise dot operators on `List<T>` (stdlib spec 2.6.7): `List op List` (same length, else a panic), `List op T` and `T op List` (the scalar applies to every element).rok::core::convertrok::core::convert: conversion traits (stdlib 2.11) and primitive impls (2.11.8).rok::core::cryptoCryptographic algorithms: pure computation, no OS (randomness is `rok::std::crypto::random`).rok::core::crypto::secretSecret storage (2.21.5): a buffer in the large-object space, so the collector never moves or copies it, zeroed by `wipe`, by `using` release and by the collection that frees it (`rok_gc_secret_new`).rok::core::crypto::sha2SHA-2 (FIPS 180-4): SHA-256, SHA-384 and SHA-512, chosen by `HashAlgorithm`; `Digest` is a running hash.rok::core::crypto::hmacHMAC (RFC 2104) and HKDF (RFC 5869) over a SHA-2 function.rok::core::crypto::sha3SHA-3 (FIPS 202): SHA3-256, SHA3-512 and the SHAKE128 / SHAKE256 extendable-output functions, all over Keccak-f[1600].rok::core::crypto::aeadAuthenticated encryption with associated data: AES-GCM (NIST SP 800-38D, 96-bit nonces) and ChaCha20-Poly1305 (RFC 8439).rok::core::crypto::x25519X25519 (RFC 7748): Diffie-Hellman on Curve25519's u coordinate.rok::core::crypto::ed25519Ed25519 (RFC 8032 5.1): pure EdDSA over edwards25519 with SHA-512.rok::core::crypto::ecdsaECDSA (FIPS 186-5) on P-256 and P-384: verification, and signing with RFC 6979 deterministic nonces.rok::core::crypto::rsaRSA (RFC 8017): PKCS #1 v1.5 and PSS verification and signing (MGF1 with the message hash), moduli of 2048 to 4096 bits.rok::core::crypto::mlkemML-KEM-768 (FIPS 203): k = 3, eta1 = eta2 = 2, du = 10, dv = 4.rok::core::errorrok::core::error - `Result<T, E>`, an error kept as a value.rok::core::fmtrok::core::fmt - `Formatter`, `Display` / `Debug`, `FormatSpec` and the f-string lowering targets (stdlib 2.10, refs-lang 1.7.3).rok::core::futurerok::core::future - `Future` / `Poll` / `Context` / `Waker` / `IntoFuture` (stdlib spec 2.20).rok::core::hintrok::core::hint - hints the optimizer honors.rok::core::indexIndexing + slicing traits.rok::core::iterIterator + IntoIterator + FromIterator (stdlib spec 2.7).rok::core::markerMarker traits used by #[derive(...)] (spec 6.2/6.4) and other compiler-driven semantics.rok::core::numrok::core::num - the primitive types' operator / comparison trait impls (stdlib spec 2.1, 2.3.5, 2.5).rok::core::num::intsrok::core::num::ints: the integer primitives' methods and limits (stdlib 2.1.4): bit operations, byte order, and the `checked_` / `wrapping_` / `saturating_` / `overflowing_` families that spell out what plain `+ - *` leave to the profile (2.3).rok::core::num::floatsrok::core::num::floats - `f32` / `f64` inherent methods and constants (stdlib spec 2.1.4).rok::core::num::bigintrok::core::num::bigint: `int`, the arbitrary-precision integer (stdlib 2.1.2, 2.1.6, 2.1.7).rok::core::num::bigfloatrok::core::num::bigfloat: `float` (stdlib 2.1.3).rok::core::num::nicherok::core::num::niche - wrappers that leave out values (stdlib spec 2.2): `NonZero<T>` (0), `NonNan<F>` (NaN), `Finite<F>` (NaN, ±∞), `Positive<T>` (negatives; refs-lang 2.7.6).rok::core::num::assignrok::core::num::assign - the `*Assign` impls (stdlib 2.4.6) of the primitives, `int` / `float` and `str`.rok::core::opsOperator traits: the source of every operator token.rok::core::panicrok::core::panic - the compiler hooks `panic_fn` / `oom_fn` / `unreachable_fn` (stdlib spec 2.14.5): print a message to stderr and exit 101.rok::core::parrok::core::par - data-parallel helpers (stdlib spec 2.19), on the process's task executor (`rok::core::task`): from async code on the worker it runs on, from sync code with the caller as a guest worker.rok::core::printrok::core::print - `print` / `println` / `eprint` / `eprintln` (stdlib 3.5.2: they live in core so the implicit `use rok::core::**` exposes them).rok::core::rangeRange / RangeInclusive / RangeFrom / RangeTo / RangeToInclusive / RangeFull (stdlib 2.7.4, refs-lang 3.7).rok::core::reflectrok::core::reflect - `Reflect` / `Inspect` (refs-lang 6.10, stdlib 2.12).rok::core::strrok::core::str - `str` methods and trait impls (stdlib 2.15).rok::core::streamrok::core::stream - `Stream` / `IntoStream` / `FromStream` (stdlib spec 2.8).rok::core::syncrok::core::sync - concurrency primitives (stdlib spec 2.16).rok::core::taskrok::core::task: tasks on the work-stealing executor (stdlib 2.18, refs-lang 7.6) and `block_on` (2.20.6); time is `task::time`.rok::core::task::timerok::core::task::time - `Duration` / `Instant` (stdlib spec 2.18.6, 3.3.2).rok::core::tuplerok::core::tuple - Clone / Copy / Default / Debug / PartialEq / Eq / Hash for tuples of 1 to 12 elements, component-wise, and PartialOrd / Ord, lexicographic (stdlib 2.5.7, 2.10.9, 2.13.6).
rok::std
Files, networking, time, threads, processes, environment, ROKON.
rok::stdrok::std tier - target-dependent.rok::std::cryptorok::std::crypto - the OS random source.rok::std::envrok::std::env (stdlib spec 306): arguments, environment variables, directories, exit.rok::std::fsrok::std::fs (stdlib 301): files and directories over the `openat` family, so a `Dir` handle is a capability.rok::std::iorok::std::io (stdlib spec 305): `IoError`, the `Reader` / `Writer` / `Seek` traits, `AsBytes` and the standard streams.rok::std::netrok::std::net (stdlib 302): TCP / UDP / Unix sockets, addresses, DNS.rok::std::net::tlsrok::std::net::tls - TLS 1.3 (stdlib spec 3.2.5), implemented here in rok on `rok::core::crypto`: no OS or external TLS library.rok::std::pathrok::std::path (stdlib spec 308): `Path`, a UTF-8 path value with Python-style `/` joining.rok::std::processrok::std::process (stdlib 307): child processes.rok::std::rokonrok::std::rokon - ROKON (Rok Object Notation, `.rokon`): one value written in rok literal syntax (stdlib spec 3.9).rok::std::rokon::readrok::std::rokon::read - lexer and recursive-descent reader for the ROKON subset of rok literal syntax (spec 3.9.1).rok::std::rokon::writerok::std::rokon::write - the canonical text of a `Value` (spec 3.9.4).rok::std::threadrok::std::thread: OS threads, 1:1 (stdlib 304, refs-lang 7.6.6).rok::std::timerok::std::time (stdlib spec 303): `Duration` / `Instant` live in `rok::core::task::time` (2.18.6) and are re-exported here; the wall clock (`SystemTime`) and the boot clock (`BootTime`) are std-only.rok::std::witrok::std::wit - the component model's async ABI (WASI preview 3) for the bindings `ffi::wit::import` / `ffi::wit::export` generate (stdlib spec 1.8): it runs on the executor, so it lives above `rok::bare::ffi::wit` (stdlib 0.1.2).