The Zuri Standard Library
Every module Zuri ships with, and every public name in each one. The pages here are generated from the library’s own doc blocks, so what you read is what the code says.
This is a reference, not a tutorial. It answers “what does this take and
what does it return”. For the narrative version, with worked examples
and the reasoning behind the design, read The Zuri Programming
Language, which cargo run-docs serves alongside this.
How to Read a Page
Every module page opens with the import that reaches it, then the
module’s own description, then its members. A package also carries an
index of its whole public surface, because a name you reach as
os.get_env may well be declared in a file called something else.
Signatures are written the way the source declares them:
name: stringis a parameter that must be a string, enforced at the call.name: ?stringaccepts a string ornil, which is how an optional argument is spelled....valuestakes any number of arguments and arrives as a list.-> stringis what the call gives back.
A name beginning with an underscore is private: the compiler refuses to import it across a module boundary, so none appear here.
The Modules
Text and Markup
Parsing, building and colouring text meant to be read.
| Module | What it is for |
|---|---|
html | A complete HTML5 parser, DOM and serializer, following the WHATWG HTML Living Standard. |
wire | Wire, an HTML template engine. |
url | This module provides classes and functions for parsing, building, resolving and processing URLs (and URL-like identifiers, such… |
mime | This module provides functions that allow easy mime type detection from files. |
colors | This module provides functionalities for color conversion and manipulation. |
Data Formats
Reading and writing the formats other programs speak.
| Module | What it is for |
|---|---|
json | Provides APIs for encoding and decoding JSON data. |
yaml | A complete, YAML 1.2.2-compliant library for parsing and emitting YAML (YAML Ain’t Markup Language) documents. |
toml | TOML, read for its values or edited in place without disturbing the file around them. |
csv | A complete, RFC 4180-compliant library for reading and writing Comma-Separated Values (CSV) data. |
base64 | This module provides interface for encoding binary data into strings and decoding such encoded strings back into binary data… |
struct | This module provides functions for converting between Zuri values and C/C++/Rust structs and vice-versa in the binary format. |
Numbers and Collections
Arithmetic, and the containers the built-in types do not cover.
| Module | What it is for |
|---|---|
math | This module contains functions and constants to make trigonometric and non-trigonometric mathematics a breeze. |
array | This module provides fixed-width typed array classes: twos- complement integers (Int8Array/UInt8Array through… |
set | This module provides functionalities for working with mathematical sets. |
Dates and Times
Calendar arithmetic, formatting, and the timezone database.
| Module | What it is for |
|---|---|
date | This modules provides Zuri’s implementation of date and time manipulation methods. |
The Machine
The filesystem, other processes, the terminal, the command line, and the configuration around them.
| Module | What it is for |
|---|---|
os | The os module is Zuri’s interface to the underlying operating system: environment variables, the filesystem, other processes,… |
env | Configuration from a file, in the environment, in the type you wanted. |
io | This module provides interfaces for working with to I/O stream and TTYs as well as expose the operating system standard I/O for… |
args | This module provides a complete, batteries-included framework for building command-line interfaces. |
log | This module implements a simple and flexible event logging system for all Zuri applications and modules. |
stat | The module provides constants and functions for interpreting results of file.stat(). |
Testing
Suites, matchers, test doubles, snapshots, and the reports they produce.
| Module | What it is for |
|---|---|
test | A testing framework: suites, assertions, mocks, snapshots, lifecycle hooks, and reports worth reading. |
Networking
Sockets, addresses, and a complete HTTP stack and JSON-RPC on top of them.
| Module | What it is for |
|---|---|
net | The net module provides networking primitives for Transmission Control Protocol and User Datagram Protocol communication as… |
http | A complete HTTP stack: a client, a server, and the pieces both are built from. |
rpc | JSON-RPC 2.0: calling methods on another program, and answering its calls, over HTTP, WebSockets, sockets, pipes, or any stream… |
Security and Identity
Hashing, signing, password storage, tokens and input validation.
| Module | What it is for |
|---|---|
crypto | Comprehensive cryptographic primitives for Zuri applications. |
hash | This module provides a framework for cryptographic and non-cryptographic encryption. |
bcrypt | Generating and verifying bcrypt password hashes, and reading information back out of an existing hash (its cost factor and salt). |
jwt | The jwt module provides a complete implementation of JSON Web Tokens (JWT) as defined in RFC 7519, with support for signing,… |
uuid | Provides RFC 9562 (and RFC 4122) compliant Universally Unique Identifier (UUID) generation, parsing, validation, and inspection. |
validate | Schema-based input validation for Zuri applications. |
Compression and Archives
Every codec and container format the runtime ships with.
| Module | What it is for |
|---|---|
compress | The compress library provides in-memory and streaming compression and decompression across several algorithms, plus… |
Concurrency
Real OS threads, with separate heaps and message passing between them.
| Module | What it is for |
|---|---|
isolate | High-throughput parallel concurrency backed by a pool of operating-system isolate threads. |
Images
Decoding, drawing, filtering and encoding raster images.
| Module | What it is for |
|---|---|
imagine | Reading, writing, drawing and transforming raster images. |
Databases
One contract every relational database answers, and the adapters that answer it.
| Module | What it is for |
|---|---|
sql | One way to talk to a relational database, whichever one it is. |
Messages, the three protocols that move them, and the servers at the far end.
| Module | What it is for |
|---|---|
mail | Mail, from the message to the socket. |
Interoperability
Calling C and Rust libraries, being called back by them, and linking static ones.
| Module | What it is for |
|---|---|
ffi | Calling C and Rust libraries, and being called by them. |
Types and Conversion
Checked coercion between types, named constants, and conversions between bases and encodings.
| Module | What it is for |
|---|---|
types | Provides type validation and conversion capabilities |
enum | This module provides Zuri’s implementation of enumerations as described in the language documentation: a set of unique values… |
convert | Data conversion between hexadecimal, arbitrary numeric bases, bytes, and decimal numbers. |
Metaprogramming
Lexing, parsing and compiling Zuri source, and reflecting on live functions, classes and modules.
| Module | What it is for |
|---|---|
zuri | Exposes Zuri’s own compiler pipeline as a library: lexing, parsing, and compiling a Zuri source file, plus a reflect submodule… |