API Reference

Source
Reference documentation for the Rux standard packages — the foundation, text, collection, system and data-format packages, cryptography, and the platform bindings for C, Linux, FreeBSD, macOS and Windows.

This reference documents the packages that ship with Rux: every public type, interface, function and constant, what it does and where it lives in the source. It is for looking things up rather than learning — if you are new to the language, start with Learn Rux or the Rux Language Reference.

Rux has no monolithic runtime. Each package below is a dependency a project declares in its manifest, and a program depends only on what it asks for.

Unstable API
None of these packages has a stable API yet. Names, signatures and behaviour may change between releases, and this reference changes with them.

Foundation

Core
Core language intrinsics
v0.1.0
Memory
Memory management functions
v0.1.0
Allocator
Allocation contracts and the allocators that meet them
v0.1.0
Math
Mathematical constants and functions
v0.1.0

Text

Text
Strings and fundamental text manipulation
v0.1.0
Format
String conversion and formatting
v0.1.0
Unicode
Unicode character properties, case, normalization and segmentation
v0.1.0
Regex
Regular expressions matched in linear time, with Unicode classes, captures, splitting and replacement
v0.1.0

Collections and algorithms

Collections
Generic data structures
v0.1.0
Algorithms
Generic algorithms over slices and mutable slices
v0.1.0
Hash
Named non-cryptographic hashes and checksums
v0.1.0
Random
Pseudorandom number generators and distributions
v0.1.0

System and I/O

Io
Streams, console I/O, readers and writers
v0.1.0
FileSystem
Files, directories and filesystem operations
v0.1.0
Path
Native operating-system strings and filesystem paths
v0.1.0
Time
Durations, monotonic clocks and wall clocks
v0.1.0
Entropy
Unpredictable bytes from the operating system
v0.1.0
Process
The running process: its command-line arguments, environment, identifier and exit
v0.1.0
CommandLine
Declarative command-line parsing: options, positional arguments, subcommands and generated help
v0.1.0
Log
Structured logging: levels, typed fields, text and JSON-lines records, a process-wide log for every thread, and log files that rotate by size
v0.1.0
TimeZone
Time zones: the tz database, POSIX rules, the local zone, and local times that happen twice or never
v0.1.0
Net
Networking: IP and socket addresses, TCP listeners and streams, UDP sockets, and name resolution
v0.1.0
Test
Unit tests: checks with readable failures, and the runner that #Test() functions are gathered into
v0.1.0

Concurrency

Thread
Threads of execution: starting, joining and detaching them, and asking about the current one
v0.1.0
Atomic
Values that threads share without a lock: atomic integers, flags and pointers
v0.1.0
Sync
Locks, conditions, once-only initialization, semaphores, barriers, wait groups and channels for threads
v0.1.0

Data formats

Json
JSON parsing and serialization
v0.1.0
Toml
TOML parsing, serialization and streaming
v0.1.0
Uuid
UUID representation, parsing, formatting and generation
v0.1.0
Encoding
Hexadecimal, Base64, Base32, Base58 and percent-encoding of byte sequences
v0.1.0
Url
URLs: parsing, normalizing and resolving them, and reading and building their queries
v0.1.0
Compress
Deflate compression in the raw, zlib and gzip formats, as streams and for whole buffers
v0.1.0
NanoId
Short, URL-safe, unpredictable identifiers in the Nano ID format
v0.1.0

Security

Crypto
Cryptographic hashes, message authentication codes and key derivation
v0.1.0

Platform bindings

C
C standard library bindings
v0.1.0
Linux
Linux platform bindings
v0.1.0Linux
FreeBSD
FreeBSD platform bindings
v0.1.0FreeBSD
macOS
macOS platform bindings
v0.1.0macOS
Windows
Windows platform bindings
v0.1.0Windows

Reading this reference

Each package has an overview page listing everything it exports, and each type, interface or function has a page of its own. A type's members — constructors, methods, operators and constants — are sections of that page, so every one has a link of its own, such as /docs/api/allocator/arena#reset.

  • Header — the declaration's kind, the package version it describes, and a Source button that opens the declaration on GitHub.
  • Sidebar — inside a package, the sidebar lists that package only, grouped into interfaces, types, functions and constants. The menu above it switches to another package.
  • Platform badges — Linux, FreeBSD, macOS and Windows each bind one operating system's own entry points, with no portability layer, and build only for that platform. Guard every call to them with conditional compilation.