rokdocs
v0.1

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::bare rok::bare - raw pointers, transmute, raw allocation, pinning and volatile access, over the runtime's `extern "rok"` symbols only.
  • rok::bare::alloc rok::bare::alloc - raw allocation outside the GC (stdlib spec 1.4).
  • rok::bare::ffi rok::bare::ffi - NUL-terminated C strings (stdlib 1.7.2); `wit` is what the WIT bindings run on (1.8).
  • rok::bare::ffi::wit rok::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::gc rok::bare::gc - keeping GC objects in place for raw pointers (stdlib spec 1.6).
  • rok::bare::mem rok::bare::mem - raw memory operations, `Pod` and bit casts (stdlib spec 1.2.5 / 1.2.6 / 1.3).
  • rok::bare::mlir rok::bare::mlir - one MLIR op written in rok (stdlib spec 1.9).
  • rok::bare::ptr rok::bare::ptr - raw pointers (stdlib spec 1.1).
  • rok::bare::volatile rok::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::core rok::core tier (foundation) - safe, target-independent.
  • rok::core::array rok::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::bench rok::core::bench - the engine `rokc bench` drives (spec 9.9.11).
  • rok::core::channel rok::core::channel - message passing between threads (stdlib spec 2.17).
  • rok::core::cmp rok::core::cmp - total equality, ordering and hashing (stdlib spec 2.5).
  • rok::core::collections rok::core::collections - List / Dict / Set / OrderedDict / OrderedSet / Slice (stdlib spec 2.9), Deque and BinaryHeap.
  • rok::core::collections::raw rok::core::collections::raw - the GC buffer the collections are built on (stdlib 2.9.12).
  • rok::core::collections::list rok::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::deque rok::core::collections::deque - `Deque<T>`, a growable ring buffer with O(1) push and pop at both ends.
  • rok::core::collections::heap rok::core::collections::heap - `BinaryHeap<T>`, a priority queue over a `List` laid out as an implicit binary tree.
  • rok::core::collections::dict rok::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::set rok::core::collections::set - `Set<T>`, a hash set (stdlib spec 2.9.4) over `Dict<T, bool>`.
  • rok::core::collections::ordered_dict rok::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_set rok::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::slice rok::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::broadcast rok::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::convert rok::core::convert: conversion traits (stdlib 2.11) and primitive impls (2.11.8).
  • rok::core::crypto Cryptographic algorithms: pure computation, no OS (randomness is `rok::std::crypto::random`).
  • rok::core::crypto::secret Secret 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::sha2 SHA-2 (FIPS 180-4): SHA-256, SHA-384 and SHA-512, chosen by `HashAlgorithm`; `Digest` is a running hash.
  • rok::core::crypto::hmac HMAC (RFC 2104) and HKDF (RFC 5869) over a SHA-2 function.
  • rok::core::crypto::sha3 SHA-3 (FIPS 202): SHA3-256, SHA3-512 and the SHAKE128 / SHAKE256 extendable-output functions, all over Keccak-f[1600].
  • rok::core::crypto::aead Authenticated encryption with associated data: AES-GCM (NIST SP 800-38D, 96-bit nonces) and ChaCha20-Poly1305 (RFC 8439).
  • rok::core::crypto::x25519 X25519 (RFC 7748): Diffie-Hellman on Curve25519's u coordinate.
  • rok::core::crypto::ed25519 Ed25519 (RFC 8032 5.1): pure EdDSA over edwards25519 with SHA-512.
  • rok::core::crypto::ecdsa ECDSA (FIPS 186-5) on P-256 and P-384: verification, and signing with RFC 6979 deterministic nonces.
  • rok::core::crypto::rsa RSA (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::mlkem ML-KEM-768 (FIPS 203): k = 3, eta1 = eta2 = 2, du = 10, dv = 4.
  • rok::core::error rok::core::error - `Result<T, E>`, an error kept as a value.
  • rok::core::fmt rok::core::fmt - `Formatter`, `Display` / `Debug`, `FormatSpec` and the f-string lowering targets (stdlib 2.10, refs-lang 1.7.3).
  • rok::core::future rok::core::future - `Future` / `Poll` / `Context` / `Waker` / `IntoFuture` (stdlib spec 2.20).
  • rok::core::hint rok::core::hint - hints the optimizer honors.
  • rok::core::index Indexing + slicing traits.
  • rok::core::iter Iterator + IntoIterator + FromIterator (stdlib spec 2.7).
  • rok::core::marker Marker traits used by #[derive(...)] (spec 6.2/6.4) and other compiler-driven semantics.
  • rok::core::num rok::core::num - the primitive types' operator / comparison trait impls (stdlib spec 2.1, 2.3.5, 2.5).
  • rok::core::num::ints rok::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::floats rok::core::num::floats - `f32` / `f64` inherent methods and constants (stdlib spec 2.1.4).
  • rok::core::num::bigint rok::core::num::bigint: `int`, the arbitrary-precision integer (stdlib 2.1.2, 2.1.6, 2.1.7).
  • rok::core::num::bigfloat rok::core::num::bigfloat: `float` (stdlib 2.1.3).
  • rok::core::num::niche rok::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::assign rok::core::num::assign - the `*Assign` impls (stdlib 2.4.6) of the primitives, `int` / `float` and `str`.
  • rok::core::ops Operator traits: the source of every operator token.
  • rok::core::panic rok::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::par rok::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::print rok::core::print - `print` / `println` / `eprint` / `eprintln` (stdlib 3.5.2: they live in core so the implicit `use rok::core::**` exposes them).
  • rok::core::range Range / RangeInclusive / RangeFrom / RangeTo / RangeToInclusive / RangeFull (stdlib 2.7.4, refs-lang 3.7).
  • rok::core::reflect rok::core::reflect - `Reflect` / `Inspect` (refs-lang 6.10, stdlib 2.12).
  • rok::core::str rok::core::str - `str` methods and trait impls (stdlib 2.15).
  • rok::core::stream rok::core::stream - `Stream` / `IntoStream` / `FromStream` (stdlib spec 2.8).
  • rok::core::sync rok::core::sync - concurrency primitives (stdlib spec 2.16).
  • rok::core::task rok::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::time rok::core::task::time - `Duration` / `Instant` (stdlib spec 2.18.6, 3.3.2).
  • rok::core::tuple rok::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::std rok::std tier - target-dependent.
  • rok::std::crypto rok::std::crypto - the OS random source.
  • rok::std::env rok::std::env (stdlib spec 306): arguments, environment variables, directories, exit.
  • rok::std::fs rok::std::fs (stdlib 301): files and directories over the `openat` family, so a `Dir` handle is a capability.
  • rok::std::io rok::std::io (stdlib spec 305): `IoError`, the `Reader` / `Writer` / `Seek` traits, `AsBytes` and the standard streams.
  • rok::std::net rok::std::net (stdlib 302): TCP / UDP / Unix sockets, addresses, DNS.
  • rok::std::net::tls rok::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::path rok::std::path (stdlib spec 308): `Path`, a UTF-8 path value with Python-style `/` joining.
  • rok::std::process rok::std::process (stdlib 307): child processes.
  • rok::std::rokon rok::std::rokon - ROKON (Rok Object Notation, `.rokon`): one value written in rok literal syntax (stdlib spec 3.9).
  • rok::std::rokon::read rok::std::rokon::read - lexer and recursive-descent reader for the ROKON subset of rok literal syntax (spec 3.9.1).
  • rok::std::rokon::write rok::std::rokon::write - the canonical text of a `Value` (spec 3.9.4).
  • rok::std::thread rok::std::thread: OS threads, 1:1 (stdlib 304, refs-lang 7.6.6).
  • rok::std::time rok::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::wit rok::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).