Standard library reference
Standard library reference
Browse the modules supplied by i and the std package.
The library reference describes the modules in std and i/…. Select a module to find its exports and source documentation. The i/… modules are supplied with the compiler; std is a separate package.
To use std in a project, put its checkout path in i.toml under [dependencies], as in std = { path = "../std" }; the path is relative to the package. For tests only, the starter project uses [dev-dependencies]. The generated reference pages take module introductions from //// comments and export documentation from /// comments. When a checked type is available, the generator includes it; otherwise it uses the source declaration.
std modules
| Module | Purpose |
|---|---|
| std/bit_array | Functions for BitArray, the type of lists of bits |
| std/bool | Functions for the built-in type Bool { True False } |
| std/calendar | Proleptic Gregorian dates for all integer years, and explicit fixed offsets |
| std/cli | Pure command argument descriptions with typed results |
| std/crypto | SHA-2 digests and key derivation in ordinary immutable i |
| std/csv | Strict CSV rows, following RFC 4180 and Go encoding/csv |
| std/dict | Dictionaries: maps from keys to values that may not be changed |
| std/float | Functions for Float, the type of finite IEEE 754 binary64 numbers |
| std/http | HTTP/1.1 messages, incremental framing, clients and scoped servers |
| std/int | Functions for Int, the type of whole numbers of any size |
| std/json | JSON values and RFC 8259 text encoding. Offsets are UTF-8 byte offsets |
| std/list | Functions for immutable lists |
| std/log | Structured entries and call-time sink services. See std-2.md §6/§7 |
| std/option | Optional values, represented by Some(value) or None |
| std/order | The result of comparing two values, and functions to work with it |
| std/pair | Functions for tuples of two parts, (a, b) |
| std/path | Lexical POSIX paths using / as the separator |
| std/property | Reproducible pure generators with lazy, ordered shrink trees |
| std/regex | Unicode scalar regular expressions: ordered Thompson NFA / PikeVM |
| std/result | Functions for the built-in type Result(A, E) { Ok(A) Error(E) } |
| std/schema | Composable two-way JSON codecs |
| std/sequence | Finite persistent indexed deques |
| std/set | Immutable sets of distinct values |
| std/stream | Replayable pull streams |
| std/string | Functions for strings of Unicode scalar values |
| std/time | Exact nanosecond durations and Unix epoch instants |
| std/uri | Strict ASCII RFC 3986 references, stored with their original encoded spelling |
i modules
| Module | Purpose |
|---|---|
| i/assertion | Taking Assert failures (§9.6) |
| i/big | Arbitrary precision Int arithmetic beyond the small range (§11.2) |
| i/bits | Integer segments of bit arrays (§8.3, §8.4) that do not fit 63 bits |
| i/clock | Clock observations and scheduler-friendly sleeps |
| i/control | One operation to pause a computation and go on with it later (§9.4) |
| i/core | The operations that are not written in i (§13) |
| i/fail | Errors (§9.3) |
| i/failure | Errors as a service (§9.3) |
| i/fetch | Fetch transport. Response handles belong to the current resource context |
| i/float_text | The text form of a Float (§11.8) |
| i/fs | File system operations |
| i/io | The standard Io service (§9.7) |
| i/key | Typed keys for heterogeneous immutable values (§9.8) |
| i/net | TCP streams, UDP datagrams and name resolution |
| i/process | Process capabilities and secure entropy |
| i/random | Pure, immutable SplitMix generators (§9.10) |
| i/request | Typed requests, cancellation groups and replaceable waits (§9.11) |
| i/resource | Final functions (§9.5) |
| i/stdio | Byte-oriented standard streams |
| i/syntax | Source syntax values for compile-time programs and tests |
| i/task | Structured tasks, rendezvous channels and events (§9.9) |
| i/tls | TLS on connected byte streams |