Table of Contents
modstd::arrayFunctions: 2 | Objects: 2 | Implementations: 5modstd::boxObjects: 1modstd::bytesType Aliases: 1 | Objects: 2 | Implementations: 2modstd::dequeObjects: 1 | Implementations: 1modstd::dictObjects: 2 | Traits: 1 | Implementations: 6modstd::encodingRe-Exports: 5modstd::encoding::asciiFunctions: 2modstd::encoding::base64Functions: 3modstd::encoding::errorsRe-Exports: 1modstd::encoding::hexFunctions: 3modstd::enumsMacros: 1modstd::envFunctions: 12 | Effects: 1modstd::errorFunctions: 2 | Objects: 7 | Traits: 1modstd::fetchFunctions: 15 | Type Aliases: 1 | Objects: 3 | Effects: 1 | Implementations: 2modstd::fsFunctions: 10 | Effects: 1modstd::inputFunctions: 6 | Objects: 1 | Effects: 1 | Implementations: 1modstd::jsonRe-Exports: 1 | Functions: 4 | Type Aliases: 1 | Objects: 6modstd::logFunctions: 20 | Type Aliases: 3 | Objects: 10 | Effects: 1modstd::mathRe-Exports: 10modstd::math::constantsFunctions: 10modstd::math::errorsFunctions: 4 | Objects: 1modstd::math::floatFunctions: 46modstd::math::intFunctions: 19modstd::math::interpolateFunctions: 28modstd::memoryFunctions: 9modstd::msgpackRe-Exports: 6 | Functions: 31modstd::msgpack::fnsType Aliases: 1modstd::msgpack::typesType Aliases: 1 | Objects: 4modstd::optionalRe-Exports: 2 | Macros: 2modstd::optional::fnsMacros: 2 | Functions: 10modstd::optional::typesType Aliases: 2 | Objects: 2modstd::outputFunctions: 16 | Type Aliases: 1 | Objects: 2 | Effects: 1modstd::pathObjects: 1 | Implementations: 1modstd::pkgRe-Exports: 84 | Macros: 4modstd::preludeRe-Exports: 45modstd::randomFunctions: 5 | Effects: 1modstd::resultRe-Exports: 2modstd::result::fnsFunctions: 7modstd::result::typesType Aliases: 1 | Objects: 3modstd::setObjects: 1 | Implementations: 1modstd::stringRe-Exports: 7 | Functions: 2modstd::string::errorsObjects: 3modstd::string::indexObjects: 1 | Implementations: 1modstd::string::typeType Aliases: 1 | Objects: 2 | Implementations: 3modstd::subscriptObjects: 1 | Traits: 2modstd::testRe-Exports: 1modstd::test::assertionsFunctions: 3 | Effects: 1modstd::timeFunctions: 4 | Objects: 3 | Effects: 1 | Implementations: 3modstd::traitsRe-Exports: 19 | Macros: 1modstd::traits::cloneTraits: 2modstd::traits::collectTraits: 1modstd::traits::convertTraits: 4modstd::traits::defaultTraits: 1modstd::traits::eqTraits: 1modstd::traits::hashTraits: 2modstd::traits::ordType Aliases: 1 | Objects: 3 | Traits: 1modstd::traits::sequenceMacros: 1 | Traits: 2modstd::versionFunctions: 2modstd::vxFunctions: 1
mod std::array
Growable contiguous arrays with copy-on-write storage.
Supports negative indexing, range slicing, and eager sequence transforms.
Functions
fn new_array<T>({ from source: FixedArray<T> }) -> Optional<Array<T>>
Creates an array from fixed storage, returning None when null entries are present.
fn new_array_unchecked<T>({ from source: FixedArray<T> }) -> Array<T>
Creates an array from fixed storage without null-entry checks.
Objects
obj Array<T>
A growable contiguous collection with copy-on-write semantics.
impl<T> Array<T>
impl<T> Array<T> for Sequence<T>
impl<T> Array<T> for SubscriptRead<i32, Optional<T>>
impl<T> Array<T> for SubscriptRead<Range, Array<T>>
impl<T> Array<T> for SubscriptWrite<i32, T>
obj ArrayPop<T>
Result payload returned by Array::popped.
mod std::box
Objects
obj Box<T>
Generic single-value container.
mod std::bytes
Byte-oriented collection types.
Bytes is an immutable view over byte data and ByteBuffer is a mutable,
growable builder. These types are useful for protocol work, file formats,
and interop with UTF-8 string APIs.
Example:
String::from_utf8(buffer.as_bytes().to_array())
converts buffered bytes into a validated String.
Type Aliases
type Byte = i32
A single byte value in the range 0..255.
Objects
obj Bytes
An immutable byte sequence view.
impl Bytes
obj ByteBuffer
A mutable, growable byte buffer.
impl ByteBuffer
mod std::deque
Double-ended queue built on top of std::array::Array.
Front operations are convenient but shift storage, so they are not constant-time.
Objects
obj Deque<T>
A double-ended queue.
Example:
let ~queue = Deque<i32>::init()
queue.push_back(1)
queue.push_front(0)
impl<T> Deque<T>
mod std::dict
Hash-map style dictionary collection.
Provides key/value storage with entry APIs, merge helpers, and iteration utilities.
Keys must implement DictKey<K> to supply hash and equality behavior.
Objects
obj DictEntry<K, V>
Entry handle for conditional dictionary updates.
Use this value with or_insert, or_insert_with, and and_modify.
impl<K, V> DictEntry<K, V>
obj Dict<K, V>
Mutable dictionary with hash-bucket storage.
Stores values by key and preserves only one value per key.
impl<K, V> Dict<K, V>
impl<K, V> Dict<K, V> for SubscriptRead<K, Optional<V>>
impl<K, V> Dict<K, V> for SubscriptWrite<K, V>
Traits
trait DictKey<K>
Key behavior required by Dict<K, V>.
Implementors define stable hashing and equality for dictionary lookups.
Implementations
impl<T> Array<T>
impl String for DictKey<String>
mod std::encoding
Text/binary encoding helpers and shared decode error types.
Re-Exports
pub ascii
pub errors
pub hex
pub base64
pub errors::DecodeError
mod std::encoding::ascii
ASCII normalization helpers for byte-to-string conversions.
Functions
fn ascii_string_from(bytes: Array<i32>) -> String
Builds a safe string from ASCII byte values.
Params:
bytes: Byte values expected to be ASCII.
Any byte outside the 0-127 range is replaced with ? (63).
fn ascii_string_from_bytes(bytes: Array<i32>) -> String
Compatibility alias for ascii_string_from(bytes: ...).
mod std::encoding::base64
RFC 4648 base64 encode/decode helpers.
Functions
fn encode(bytes: Bytes) -> String
Encodes bytes as RFC 4648 base64 (with = padding).
Params:
bytes: Raw bytes to encode.
Returns an ASCII base64 string.
Example:
use std::encoding::base64
use std::bytes::ByteBuffer
let source = ByteBuffer::from_utf8("voyd")
let encoded = base64::encode(source.as_bytes())fn decode(s: String) -> Result<Bytes, DecodeError>
Decodes a base64 string into bytes.
fn decode(s: StringSlice) -> Result<Bytes, DecodeError>
Decodes a base64 string into bytes.
Params:
s: Base64 text with optional=padding.
Returns:
Ok<Bytes>for valid base64 input.Err<DecodeError>for invalid length, invalid characters, or invalid padding.
Example:
use std::encoding::base64
let decoded = base64::decode("dm95ZA==".as_slice())mod std::encoding::errors
Re-Exports
pub std::error::DecodeError
mod std::encoding::hex
Lower-case hexadecimal encode/decode helpers.
Functions
fn encode(bytes: Bytes) -> String
Encodes bytes as lower-case hexadecimal.
Params:
bytes: Raw bytes to encode.
Returns an ASCII hex string that is always lower-case.
Example:
use std::encoding::hex
use std::bytes::ByteBuffer
let source = ByteBuffer::from_utf8("ok")
let encoded = hex::encode(source.as_bytes())fn decode(s: String) -> Result<Bytes, DecodeError>
Decodes a hexadecimal string into bytes.
fn decode(s: StringSlice) -> Result<Bytes, DecodeError>
Decodes a hexadecimal string into bytes.
Params:
s: Hex text using two digits per byte.
Returns:
Ok<Bytes>for valid hex input.Err<DecodeError>when the length is odd or any character is not hex.
Example:
use std::encoding::hex
let decoded = hex::decode("766f7964".as_slice())mod std::enums
Macros
macro enum
Quick way to define a union type with multiple inline object variants.
For example:
enum Result
Foo<T> { value: T }
Bar { value: i32 }
Bazmod std::env
Environment variable access backed by host process APIs.
std::env exposes typed reads for string/boolean/integer values plus a host-backed
mutation API for setting variables.
Functions
fn get(key: String): Env -> Option<String>
Reads an environment variable as a string, returning None when the key is missing.
fn get(key: StringSlice): Env -> Option<String>
fn get_boolean(key: String): Env -> Option<bool>
Reads an environment variable and parses it as a boolean.
fn get_boolean(key: StringSlice): Env -> Option<bool>
fn get_bool(key: String): Env -> Option<bool>
Compatibility alias for get_boolean.
fn get_bool(key: StringSlice): Env -> Option<bool>
Compatibility alias for get_boolean.
fn get_integer(key: String): Env -> Option<i32>
Reads an environment variable and parses it as a 32-bit integer.
fn get_integer(key: StringSlice): Env -> Option<i32>
fn get_int(key: String): Env -> Option<i32>
Compatibility alias for get_integer.
fn get_int(key: StringSlice): Env -> Option<i32>
Compatibility alias for get_integer.
fn set(key: String, value: String): Env -> Result<Unit, HostError>
Sets an environment variable to the provided string value.
fn set(key: StringSlice, value: StringSlice): Env -> Result<Unit, HostError>
Effects
eff Env
Host environment effect used by std::env.
Operations in this effect mirror host process environment APIs and exchange
MessagePack payloads for typed decoding in this module.
mod std::error
Shared error object definitions and panic primitive for the standard library.
These types model common failure categories surfaced by std modules and host
effects, while panic exposes an intrinsic trap for unrecoverable failures.
Functions
fn panic(_message: String) -> void
Stops execution immediately with a panic.
fn panic(_message: StringSlice) -> void
Objects
obj Utf8Error
obj ParseIntError
obj ParseFloatError
obj DecodeError
obj JsonError
obj HostError
obj IoError
Traits
trait Error<T>
mod std::fetch
HTTP request/response helpers backed by the host networking runtime.
std::fetch provides typed request and response DTOs plus convenience helpers
for common HTTP workflows. Requests are encoded as MessagePack maps for the host
Fetch effect and decoded back into Result<FetchResponse, HostError>.
Functions
fn header(
{
name: String
value: String
}
): () -> FetchHeader
Creates one header value.
fn header(
{
name: StringSlice
value: StringSlice
}
): () -> FetchHeader
Creates one header value.
fn request({ request: FetchRequest }): Fetch -> Result<FetchResponse, HostError>
Sends an HTTP request.
This is the lowest-level public API in this module and accepts a fully-built
FetchRequest value.
fn request(
{
method: String
url: String
headers?: FetchHeaders
body?: String
timeout_millis?: i32
}
): Fetch -> Result<FetchResponse, HostError>
Sends an HTTP request from explicit values.
Example:
let response = fetch::request_with(method: "PUT".as_slice(), url: url)
fn request(
{
method: StringSlice
url: StringSlice
headers?: FetchHeaders
body?: StringSlice
timeout_millis?: i32
}
): Fetch -> Result<FetchResponse, HostError>
Sends an HTTP request from explicit values.
Example:
let response = fetch::request_with(method: "PUT".as_slice(), url: url)
fn request_with(
{
method: String
url: String
headers?: FetchHeaders
body?: String
timeout_millis?: i32
}
): Fetch -> Result<FetchResponse, HostError>
Sends an HTTP request from explicit values.
fn request_with(
{
method: StringSlice
url: StringSlice
headers?: FetchHeaders
body?: StringSlice
timeout_millis?: i32
}
): Fetch -> Result<FetchResponse, HostError>
Sends an HTTP request from explicit values.
fn get(url: String): Fetch -> Result<FetchResponse, HostError>
Sends a GET request.
Example:
let response = fetch::request_get("https://voyd.dev".as_slice())
fn get(url: StringSlice): Fetch -> Result<FetchResponse, HostError>
Sends a GET request.
fn request_get(url: String): Fetch -> Result<FetchResponse, HostError>
Sends a GET request.
Example:
let response = fetch::request_get("https://voyd.dev".as_slice())
fn request_get(url: StringSlice): Fetch -> Result<FetchResponse, HostError>
Sends a GET request.
fn post(
{
url: String
body: String
}
): Fetch -> Result<FetchResponse, HostError>
Sends a POST request with a text body.
fn post(
{
url: StringSlice
body: StringSlice
}
): Fetch -> Result<FetchResponse, HostError>
Sends a POST request with a text body.
fn request_post(
{
url: String
body: String
}
): Fetch -> Result<FetchResponse, HostError>
Sends a POST request with a text body.
Example:
let response = fetch::request_post(url: api.as_slice(), body: payload.as_slice())
fn request_post(
{
url: StringSlice
body: StringSlice
}
): Fetch -> Result<FetchResponse, HostError>
Sends a POST request with a text body.
Type Aliases
type FetchHeaders = Array<FetchHeader>
Objects
obj FetchHeader
obj FetchRequest
impl FetchRequest
obj FetchResponse
impl FetchResponse
Effects
eff Fetch
Host networking effect used by std::fetch.
The payload is a MessagePack map with request metadata and optional body/timeout.
mod std::fs
File system APIs backed by host runtime operations.
std::fs provides read/write/existence/listing helpers that operate on
std::path::Path and return typed Result values where host I/O can fail.
All effect payloads are MessagePack-encoded DTOs.
Functions
fn read_bytes(path: Path): Fs -> Result<Bytes, IoError>
Reads a file as raw bytes.
Example:
let bytes = fs::read_bytes(Path::new("./image.bin".as_slice()))
fn read(path: Path): Fs -> Result<String, IoError>
Reads text from a file.
This expects host-side UTF-8 text decoding.
fn read_string(path: Path): Fs -> Result<String, IoError>
Reads text from a file.
This expects host-side UTF-8 text decoding.
fn write_bytes(path: Path, bytes: Bytes): Fs -> Result<Unit, IoError>
Writes bytes to a file.
Example:
let write_result = fs::write_bytes(file_path, payload)
fn write(path: Path, value: String): Fs -> Result<Unit, IoError>
Writes text to a file.
Example:
let write_result = fs::write_string(file_path, "hello".as_slice())
fn write(path: Path, value: StringSlice): Fs -> Result<Unit, IoError>
Writes text to a file.
fn write_string(path: Path, value: String): Fs -> Result<Unit, IoError>
Writes text to a file.
Example:
let write_result = fs::write_string(file_path, "hello".as_slice())
fn write_string(path: Path, value: StringSlice): Fs -> Result<Unit, IoError>
Writes text to a file.
fn exists(path: Path): Fs -> bool
Returns true when the path exists in the file system.
fn list_dir(path: Path): Fs -> Result<Array<Path>, IoError>
Lists child paths in a directory.
Each returned Path is decoded from host-provided string entries.
Effects
eff Fs
Host file-system effect used by std::fs.
Operations in this effect proxy host file APIs using MessagePack payloads
and return DTOs decoded by helper functions in this module.
mod std::input
Standard input helpers backed by host-provided input streams.
std::input supports line-based reads, raw byte reads, and terminal detection.
Host interactions are encoded as MessagePack DTOs and decoded into typed results.
Functions
fn read_line(): Input -> Result<Option<String>, HostError>
Reads a line from stdin (or host prompt source).
Returns Ok(None) at end-of-input.
fn read_line(prompt: StringSlice): Input -> Result<Option<String>, HostError>
Reads a line using a prompt.
Example:
let next = input::read_line("> ".as_slice())
fn read_line(prompt: String): Input -> Result<Option<String>, HostError>
Reads a line using a prompt.
fn read_line(request: InputRequest): Input -> Result<Option<String>, HostError>
Reads a line using an explicit request value.
fn read_bytes(max_bytes: i32): Input -> Result<Option<Bytes>, IoError>
Reads up to max_bytes raw bytes from stdin.
Returns Ok(None) when no more bytes are available.
fn is_tty(): Input -> bool
Returns true when stdin is attached to an interactive terminal.
Objects
obj InputRequest
impl InputRequest
Effects
eff Input
Host input effect used by std::input.
Operations in this effect map host stdin facilities into typed MessagePack
DTOs consumed by this module.
mod std::json
JSON value model and UTF-8 parser/serializer helpers.
Use parse to decode JSON text into JsonValue and stringify/stringify_pretty
to encode values back to text.
Re-Exports
pub std::error::JsonError
Functions
fn parse(source: String) -> Result<JsonValue, JsonError>
Parses UTF-8 JSON text into a JsonValue.
Params:
source: JSON source text.
Returns:
Ok<JsonValue>when the full input parses successfully.Err<JsonError>for malformed JSON or trailing characters.
Example:
use std::json
let parsed = json::parse("{\"ok\":true}")fn parse(source: StringSlice) -> Result<JsonValue, JsonError>
fn stringify(value: JsonValue) -> String
Serializes a JsonValue to compact JSON text.
Params:
value: JSON value to serialize.
Example:
use std::json
let text = json::stringify(JsonBool { value: true })fn stringify_pretty(value: JsonValue) -> String
Serializes a JsonValue to pretty JSON text with indentation.
Params:
value: JSON value to serialize.
Type Aliases
type JsonValue = |(JsonNull, |(JsonBool, |(JsonNumber, |(JsonString, |(JsonArray, JsonObject)))))
Tagged union over all supported JSON value variants.
Objects
obj JsonNull
Represents the JSON null literal.
obj JsonBool
Represents a JSON boolean literal.
obj JsonNumber
Represents a JSON number.
obj JsonString
Represents a JSON string.
obj JsonArray
Represents a JSON array.
obj JsonObject
Represents a JSON object keyed by strings.
mod std::log
Structured logging primitives backed by a host logging sink.
std::log exposes level-specific helpers and typed field values for structured
payloads. Messages and fields are encoded as MessagePack maps/arrays.
Functions
fn trace(message: StringSlice): Log -> void
Emits a trace-level log message.
fn trace(message: String): Log -> void
Emits a trace-level log message.
fn trace(message: StringSlice, fields: LogFields): Log -> void
Emits a trace-level log message.
fn trace(message: String, fields: LogFields): Log -> void
Emits a trace-level log message.
fn debug(message: StringSlice): Log -> void
Emits a debug-level log message.
fn debug(message: String): Log -> void
Emits a debug-level log message.
fn debug(message: StringSlice, fields: LogFields): Log -> void
Emits a debug-level log message.
fn debug(message: String, fields: LogFields): Log -> void
Emits a debug-level log message.
fn info(message: StringSlice): Log -> void
Emits an info-level log message.
fn info(message: String): Log -> void
Emits an info-level log message.
fn info(message: StringSlice, fields: LogFields): Log -> void
Emits an info-level log message.
fn info(message: String, fields: LogFields): Log -> void
Emits an info-level log message.
fn warn(message: StringSlice): Log -> void
Emits a warning-level log message.
fn warn(message: String): Log -> void
Emits a warning-level log message.
fn warn(message: StringSlice, fields: LogFields): Log -> void
Emits a warning-level log message.
fn warn(message: String, fields: LogFields): Log -> void
Emits a warning-level log message.
fn error(message: StringSlice): Log -> void
Emits an error-level log message.
fn error(message: String): Log -> void
Emits an error-level log message.
fn error(message: StringSlice, fields: LogFields): Log -> void
Emits an error-level log message.
fn error(message: String, fields: LogFields): Log -> void
Emits an error-level log message.
Type Aliases
type LogLevel = |(LogTrace, |(LogDebug, |(LogInfo, |(LogWarn, LogError))))
type LogFieldValue = |(LogString, |(LogInt, |(LogFloat, LogBool)))
type LogFields = Array<LogField>
Objects
obj LogTrace
obj LogDebug
obj LogInfo
obj LogWarn
obj LogError
obj LogString
obj LogInt
obj LogFloat
obj LogBool
obj LogField
Effects
eff Log
Host logging effect used by std::log.
std::log converts typed log-level and field values into a MessagePack map
consumed by the host log sink.
mod std::math
Math APIs for integer, float, interpolation, constants, and math errors.
Import through std::math for namespaced calls (for example,
math::pow(2.0, 3.0)), or import math::all to enable UFCS-style calls
such as 2.0.pow(3.0).
Re-Exports
pub constants
pub errors
pub float
pub int
pub interpolate
pub errors::MathError
pub constants::all
pub float::all
pub int::all
pub interpolate::all
mod std::math::constants
Mathematical constants and unit conversion helpers.
Functions
fn pi_f64() -> f64
Returns Archimedes' constant as f64.
fn pi_f32() -> f32
Returns Archimedes' constant as f32.
fn tau_f64() -> f64
Returns Tau (2Ï€) as f64.
fn tau_f32() -> f32
Returns Tau (2Ï€) as f32.
fn e_f64() -> f64
Returns Euler's number as f64.
fn e_f32() -> f32
Returns Euler's number as f32.
fn deg_to_rad(value: f64) -> f64
Converts degrees to radians.
value is interpreted as degrees.
fn deg_to_rad(value: f32) -> f32
Converts degrees to radians.
fn rad_to_deg(value: f64) -> f64
Converts radians to degrees.
value is interpreted as radians.
fn rad_to_deg(value: f32) -> f32
Converts radians to degrees.
mod std::math::errors
Math-specific error types and stable error code helpers.
Functions
fn math_error_code_invalid_input() -> i32
Error code for invalid input values.
fn math_error_code_overflow() -> i32
Error code for overflow conditions.
fn math_error_code_divide_by_zero() -> i32
Error code for divide-by-zero conditions.
fn math_error<T>(code: i32) -> Result<T, MathError>
Constructs a MathError result with the provided code.
Objects
obj MathError
Error type returned by fallible std math APIs.
mod std::math::float
Floating-point and numeric helper APIs used by std::math.
Functions in this module favor direct Wasm intrinsics for predictable
runtime behavior across hosts.
Functions
fn abs(value: i32) -> Result<i32, MathError>
Returns the absolute value, rejecting signed overflow.
fn abs(value: i64) -> Result<i64, MathError>
Returns the absolute value, rejecting signed overflow.
fn abs(value: f64) -> f64
Returns the absolute value.
fn abs(value: f32) -> f32
Returns the absolute value.
fn signum(value: i32) -> i32
Returns the sign of value as -1, 0, or 1.
fn signum(value: i64) -> i64
Returns the sign of value as -1, 0, or 1.
fn signum(value: f64) -> f64
Returns the sign of value as -1, 0, or 1.
Returns NaN unchanged.
fn signum(value: f32) -> f32
Returns the sign of value as -1, 0, or 1.
Returns NaN unchanged.
fn floor(value: f64) -> f64
Rounds value down to the nearest integer.
fn floor(value: f32) -> f32
Rounds value down to the nearest integer.
fn ceil(value: f64) -> f64
Rounds value up to the nearest integer.
fn ceil(value: f32) -> f32
Rounds value up to the nearest integer.
fn round(value: f64) -> f64
Rounds value to the nearest integer using ties-to-even semantics.
fn round(value: f32) -> f32
Rounds value to the nearest integer using ties-to-even semantics.
fn trunc(value: f64) -> f64
Rounds value toward zero.
fn trunc(value: f32) -> f32
Rounds value toward zero.
fn fract(value: f64) -> f64
Returns the fractional component of value.
fn fract(value: f32) -> f32
Returns the fractional component of value.
fn sqrt(value: f64) -> f64
Returns the square root of value.
fn sqrt(value: f32) -> f32
Returns the square root of value.
fn hypot(x: f64, y: f64) -> f64
Returns the Euclidean norm of (x, y): sqrt(xx + yy).
fn hypot(x: f32, y: f32) -> f32
Returns the Euclidean norm of (x, y): sqrt(xx + yy).
fn pow(value: f64, exponent: f64) -> f64
Raises value to the power of exponent.
fn pow(value: f32, exponent: f32) -> f32
Raises value to the power of exponent.
fn sin(value: f64) -> f64
Returns the sine of value (radians).
fn sin(value: f32) -> f32
Returns the sine of value (radians).
fn cos(value: f64) -> f64
Returns the cosine of value (radians).
fn cos(value: f32) -> f32
Returns the cosine of value (radians).
fn tan(value: f64) -> f64
Returns the tangent of value (radians).
fn tan(value: f32) -> f32
Returns the tangent of value (radians).
fn atan2(y: f64, x: f64) -> f64
Returns the angle in radians between the positive x-axis and (x, y).
Parameter order follows atan2(y, x).
fn atan2(y: f32, x: f32) -> f32
Returns the angle in radians between the positive x-axis and (x, y).
Parameter order follows atan2(y, x).
fn ln(value: f64) -> f64
Returns the natural logarithm (base e).
fn ln(value: f32) -> f32
Returns the natural logarithm (base e).
fn log2(value: f64) -> f64
Returns the base-2 logarithm.
fn log2(value: f32) -> f32
Returns the base-2 logarithm.
fn log10(value: f64) -> f64
Returns the base-10 logarithm.
fn log10(value: f32) -> f32
Returns the base-10 logarithm.
fn exp(value: f64) -> f64
Returns e raised to value.
fn exp(value: f32) -> f32
Returns e raised to value.
fn is_nan(value: f64) -> bool
Returns true when value is NaN.
fn is_nan(value: f32) -> bool
Returns true when value is NaN.
fn is_finite(value: f64) -> bool
Returns true when value is finite.
Finite means not NaN and not positive/negative infinity.
fn is_finite(value: f32) -> bool
Returns true when value is finite.
fn is_infinite(value: f64) -> bool
Returns true when value is infinite.
fn is_infinite(value: f32) -> bool
Returns true when value is infinite.
mod std::math::int
Integer math helpers for comparisons, Euclidean remainder, and
overflow-aware arithmetic operations.
Functions
fn max<T>(a: T, b: T) -> T
Returns the larger of a and b.
fn min<T>(a: T, b: T) -> T
Returns the smaller of a and b.
fn mod_euclid(value: i32, modulus: i32) -> Result<i32, MathError>
Returns the non-negative Euclidean remainder for 32-bit integers.
modulus must be greater than zero.
fn mod_euclid(value: i64, modulus: i64) -> Result<i64, MathError>
Returns the non-negative Euclidean remainder for 64-bit integers.
modulus must be greater than zero.
fn rem_euclid(value: i32, modulus: i32) -> Result<i32, MathError>
Returns the Euclidean remainder for 32-bit integers.
fn rem_euclid(value: i64, modulus: i64) -> Result<i64, MathError>
Returns the Euclidean remainder for 64-bit integers.
fn div_rem(value: i32, divisor: i32) -> (i32, i32)
Returns quotient and remainder for 32-bit integers.
divisor must not be zero.
fn div_rem(value: i64, divisor: i64) -> (i64, i64)
Returns quotient and remainder for 64-bit integers.
divisor must not be zero.
fn checked_div_rem(value: i32, divisor: i32) -> Result<(i32, i32), MathError>
Returns quotient and remainder, rejecting divide-by-zero and signed overflow.
Signed overflow covers the MIN / -1 case.
fn checked_div_rem(value: i32, { by divisor: i32 }) -> Result<(i32, i32), MathError>
Returns quotient and remainder using a labeled divisor argument.
fn checked_div_rem(value: i64, divisor: i64) -> Result<(i64, i64), MathError>
Returns quotient and remainder, rejecting divide-by-zero and signed overflow.
Signed overflow covers the MIN / -1 case.
fn checked_div_rem(value: i64, { by divisor: i64 }) -> Result<(i64, i64), MathError>
Returns quotient and remainder using a labeled divisor argument.
fn next_power_of_two(value: i32) -> Result<i32, MathError>
Returns the next power of two for a 32-bit integer.
Values less than or equal to 1 return 1.
fn is_power_of_two(value: i32) -> bool
Returns true when value is a power of two.
fn is_power_of_two(value: i64) -> bool
Returns true when value is a power of two.
fn prev_power_of_two(value: i32) -> Result<i32, MathError>
Returns the greatest power of two less than or equal to value.
value must be positive.
fn prev_power_of_two(value: i64) -> Result<i64, MathError>
Returns the greatest power of two less than or equal to value.
value must be positive.
fn next_multiple_of(value: i32, factor: i32) -> Result<i32, MathError>
Returns the smallest multiple of factor that is greater than or equal to value.
factor must be positive.
fn next_multiple_of(value: i64, factor: i64) -> Result<i64, MathError>
Returns the smallest multiple of factor that is greater than or equal to value.
factor must be positive.
mod std::math::interpolate
Interpolation and range-mapping helpers for scalar numeric values.
Includes clamping, range checks, forward interpolation, inverse
interpolation, and range remapping.
Functions
fn clamp(value: i32, min: i32, max: i32) -> i32
Returns value clamped between min and max (inclusive).
fn clamp(
value: i32,
{
min: i32
max: i32
}
) -> i32
Returns value clamped between min and max (inclusive).
fn clamp(value: i64, min: i64, max: i64) -> i64
Returns value clamped between min and max (inclusive).
fn clamp(
value: i64,
{
min: i64
max: i64
}
) -> i64
Returns value clamped between min and max (inclusive).
fn clamp(value: f32, min: f32, max: f32) -> f32
Returns value clamped between min and max (inclusive).
fn clamp(
value: f32,
{
min: f32
max: f32
}
) -> f32
Returns value clamped between min and max (inclusive).
fn clamp(value: f64, min: f64, max: f64) -> f64
Returns value clamped between min and max (inclusive).
fn clamp(
value: f64,
{
min: f64
max: f64
}
) -> f64
Returns value clamped between min and max (inclusive).
fn between(value: i32, min: i32, max: i32) -> bool
Returns true when value is within min..=max.
fn between(
value: i32,
{
min: i32
max: i32
}
) -> bool
Returns true when value is within min..=max.
fn between(value: i64, min: i64, max: i64) -> bool
Returns true when value is within min..=max.
fn between(
value: i64,
{
min: i64
max: i64
}
) -> bool
Returns true when value is within min..=max.
fn between(value: f32, min: f32, max: f32) -> bool
Returns true when value is within min..=max.
fn between(
value: f32,
{
min: f32
max: f32
}
) -> bool
Returns true when value is within min..=max.
fn between(value: f64, min: f64, max: f64) -> bool
Returns true when value is within min..=max.
fn between(
value: f64,
{
min: f64
max: f64
}
) -> bool
Returns true when value is within min..=max.
fn lerp(start: f64, end: f64, t: f64) -> f64
Returns the linear interpolation between start and end at t.
t is interpolation progress where 0 returns start and 1 returns end.
Example: lerp(10.0, 20.0, 0.25) == 12.5.
Supports UFCS call style: 0.0.lerp(10.0, 0.25).
fn lerp(
start: f64,
{
to end: f64
at t: f64
}
) -> f64
Returns the linear interpolation between start and end at t.
fn lerp(start: f32, end: f32, t: f32) -> f32
Returns the linear interpolation between start and end at t.
t is interpolation progress where 0 returns start and 1 returns end.
fn lerp(
start: f32,
{
to end: f32
at t: f32
}
) -> f32
Returns the linear interpolation between start and end at t.
fn inverse_lerp(value: f64, start: f64, end: f64) -> f64
Returns interpolation progress of value within the range start..end.
A return value of 0 means value == start, and 1 means value == end.
Example: inverse_lerp(5.0, 0.0, 10.0) == 0.5.
Supports UFCS call style: 5.0.inverse_lerp(0.0, 10.0).
fn inverse_lerp(
value: f64,
{
start: f64
end: f64
}
) -> f64
Returns interpolation progress of value within the range start..end.
fn inverse_lerp(value: f32, start: f32, end: f32) -> f32
Returns interpolation progress of value within the range start..end.
A return value of 0 means value == start, and 1 means value == end.
fn inverse_lerp(
value: f32,
{
start: f32
end: f32
}
) -> f32
Returns interpolation progress of value within the range start..end.
fn map_range(value: f64, in_min: f64, in_max: f64, out_min: f64, out_max: f64) -> f64
Maps value from one range into another range.
in_min/in_max define the input range and out_min/out_max define
the destination range.
Example: map_range(5.0, 0.0, 10.0, 100.0, 200.0) == 150.0.
Supports UFCS call style: 5.0.map_range(0.0, 10.0, 100.0, 200.0).
fn map_range(
value: f64,
{
in_min: f64
in_max: f64
out_min: f64
out_max: f64
}
) -> f64
Maps value from one range into another range.
fn map_range(value: f32, in_min: f32, in_max: f32, out_min: f32, out_max: f32) -> f32
Maps value from one range into another range.
fn map_range(
value: f32,
{
in_min: f32
in_max: f32
out_min: f32
out_max: f32
}
) -> f32
Maps value from one range into another range.
mod std::memory
Low-level WebAssembly linear memory intrinsics.
These APIs are thin wrappers over compiler intrinsics and are intended for
runtime and systems-level utilities that need explicit memory access.
Functions
fn size(): () -> i32
Returns the current WebAssembly memory size in pages.
fn grow(pages: i32): () -> i32
Grows WebAssembly linear memory by page count and returns the previous size.
fn load_u8(ptr: i32): () -> i32
Reads an unsigned 8-bit value from linear memory.
fn store_u8(ptr: i32, value: i32): () -> void
Writes an unsigned 8-bit value to linear memory.
fn load_u16(ptr: i32): () -> i32
Reads an unsigned 16-bit value from linear memory.
fn store_u16(ptr: i32, value: i32): () -> void
Writes an unsigned 16-bit value to linear memory.
fn load_u32(ptr: i32): () -> i32
Reads an unsigned 32-bit value from linear memory.
fn store_u32(ptr: i32, value: i32): () -> void
Writes an unsigned 32-bit value to linear memory.
fn copy(dest: i32, src: i32, len: i32): () -> void
Copies len bytes from src to dest in linear memory.
mod std::msgpack
Public MessagePack API surface for constructing values and encoding/decoding
them at the Wasm memory boundary.
Re-Exports
pub fns::MsgPack
pub types::Binary
pub types::Bool
pub types::F64
pub types::Null
pub types::Numeric
Functions
fn make_null(): () -> MsgPack
Returns a MessagePack null value.
fn make_bool(value: bool): () -> MsgPack
Wraps a boolean as a MessagePack value.
fn make_string(value: String): () -> MsgPack
Wraps a string as a MessagePack value.
fn make_binary(value: Binary): () -> MsgPack
Wraps binary data as a MessagePack value.
fn make_array(value: Array<MsgPack>): () -> MsgPack
Wraps an array as a MessagePack value.
fn make_f32(value: f32): () -> MsgPack
Wraps a 32-bit float as a MessagePack value.
fn make_f64(value: f64): () -> MsgPack
Wraps a 64-bit float as a MessagePack value.
fn make_i32(value: i32): () -> MsgPack
Wraps a 32-bit integer as a MessagePack value.
fn make_i64(value: i64): () -> MsgPack
Wraps a 64-bit integer as a MessagePack value.
fn make_map(value: Dict<String, MsgPack>): () -> MsgPack
Wraps a string-keyed dictionary as a MessagePack map value.
fn unpack_bool(value: MsgPack): () -> bool
Extracts a boolean from a MessagePack value.
fn unpack_string(value: MsgPack): () -> String
Extracts a string from a MessagePack value.
fn unpack_binary(value: MsgPack): () -> Binary
Extracts binary data from a MessagePack value.
fn unpack_array(value: MsgPack): () -> Array<MsgPack>
Extracts an array from a MessagePack value.
fn unpack_f32(value: MsgPack): () -> f32
Extracts a 32-bit float from a MessagePack value.
fn unpack_f64(value: MsgPack): () -> f64
Extracts a 64-bit float from a MessagePack value.
fn unpack_i32(value: MsgPack): () -> i32
Extracts a 32-bit integer from a MessagePack value.
fn unpack_i64(value: MsgPack): () -> i64
Extracts a 64-bit integer from a MessagePack value.
fn unpack_map(value: MsgPack): () -> Dict<String, MsgPack>
Extracts a string-keyed map from a MessagePack value.
fn pack_null(): () -> MsgPack
Alias for creating a MessagePack null value.
fn pack_bool(value: bool): () -> MsgPack
Alias for creating a MessagePack boolean value.
fn pack_string(value: String): () -> MsgPack
Alias for creating a MessagePack string value.
fn pack_binary(value: Binary): () -> MsgPack
Alias for creating a MessagePack binary value.
fn pack_array(value: Array<MsgPack>): () -> MsgPack
Alias for creating a MessagePack array value.
fn pack_f32(value: f32): () -> MsgPack
Alias for creating a MessagePack 32-bit float value.
fn pack_f64(value: f64): () -> MsgPack
Alias for creating a MessagePack 64-bit float value.
fn pack_i32(value: i32): () -> MsgPack
Alias for creating a MessagePack 32-bit integer value.
fn pack_i64(value: i64): () -> MsgPack
Alias for creating a MessagePack 64-bit integer value.
fn pack_map(value: Dict<String, MsgPack>): () -> MsgPack
Alias for creating a MessagePack map value.
fn encode_value(value: MsgPack, ptr: i32, len: i32): () -> i32
Encodes one MessagePack value into a caller-provided memory region.
Params:
value: MessagePack value to encode.ptr: Start offset in linear memory where bytes are written.len: Maximum bytes available atptr.
Returns the number of bytes written, or -1 if the destination region is too small.
Example:
use std::msgpack
let used = msgpack::encode_value(msgpack::make_i32(7), ptr, len)fn decode_value(ptr: i32, len: i32): () -> MsgPack
Decodes one MessagePack value from a memory region.
Params:
ptr: Start offset in linear memory where encoded bytes are read.len: Number of readable bytes fromptr.
Returns the decoded value, or Null when decoding fails.
Example:
use std::msgpack
let value = msgpack::decode_value(ptr, len)mod std::msgpack::fns
MessagePack serializer implementation used by std::msgpack.
This module owns the in-memory codec and value constructors/unpackers.
Type Aliases
type MsgPack = |(Null, |(Numeric, |(Bool, |(String, |(Binary, |(Array<MsgPack>, MsgPackMap))))))
Recursive MessagePack value union used by the serializer boundary.
mod std::msgpack::types
Primitive wrapper types used by std::msgpack value unions.
Type Aliases
type Numeric = |(I32, |(I64, |(F32, F64)))
Numeric subset of MessagePack wrapper types.
Objects
obj F64
MessagePack 64-bit float wrapper.
obj Bool
MessagePack boolean wrapper.
obj Null
MessagePack null wrapper.
obj Binary
MessagePack binary payload wrapper.
mod std::optional
Optional standard module.
Re-exports optional value types and helper functions.
Re-Exports
pub types::all
pub fns::all
Macros
macro ??
macro ?.
mod std::optional::fns
Optional helper functions.
Constructors, predicates, and combinators for Optional<T> values.
Macros
macro ??
macro ?.
Functions
fn some<T>(value: T): () -> Optional<T>
Constructs an optional value containing value.
fn none<T>(): () -> Optional<T>
Constructs an empty optional value.
fn is_some<T>(opt: Optional<T>): () -> boolean
Returns true when the optional value is present.
fn is_none<T>(opt: Optional<T>): () -> boolean
Returns true when the optional value is absent.
fn unwrap_or<T>(opt: Optional<T>, default: T): () -> T
Returns the contained value or a fallback.
fn unwrap_or_else<T>(
opt: Optional<T>,
default: (()) -> T
) -> T
Returns the contained value or computes a fallback lazily.
fn map<T, U>(
opt: Optional<T>,
f: (v: T) -> U
) -> Optional<U>
Transforms a present value and leaves None unchanged.
fn and_then<T, U>(
opt: Optional<T>,
f: (v: T) -> Optional<U>
) -> Optional<U>
Runs f when a value is present and flattens the result.
fn or_value<T>(opt: Optional<T>, fallback: Optional<T>): () -> Optional<T>
Returns opt when present, otherwise fallback.
fn or_else<T>(
opt: Optional<T>,
fallback: (()) -> Optional<T>
) -> Optional<T>
Returns opt when present, otherwise computes a fallback optional value.
mod std::optional::types
Optional type definitions.
Defines Some, None, and aliases used across the standard library.
Type Aliases
type Optional<T> = |(Some<T>, None)
Optional sum type.
Represents either Some<T> or None.
type Option<T> = Optional<T>
Alias for Optional<T>.
Objects
obj Some<T>
Present optional variant.
Contains a payload value of type T.
obj None
Empty optional variant.
mod std::output
Standard output/error stream helpers backed by host runtime operations.
std::output provides text and byte writes, flushing, and TTY checks for
stdout and stderr using MessagePack DTO payloads.
Functions
fn write(value: StringSlice): Output -> Result<Unit, IoError>
Writes text to the selected output target (stdout by default).
Example:
let result = output::write("hello".as_slice())
fn write(value: String): Output -> Result<Unit, IoError>
Writes text to the selected output target (stdout by default).
fn write(value: StringSlice, target: OutputTarget): Output -> Result<Unit, IoError>
Writes text to the selected output target.
fn write(value: String, target: OutputTarget): Output -> Result<Unit, IoError>
Writes text to the selected output target.
fn write_line(value: StringSlice): Output -> Result<Unit, IoError>
Writes text followed by exactly \n to the selected target (stdout by default).
fn write_line(value: String): Output -> Result<Unit, IoError>
Writes text followed by exactly \n to the selected target (stdout by default).
fn write_line(value: StringSlice, target: OutputTarget): Output -> Result<Unit, IoError>
Writes text followed by exactly \n to the selected target.
This always appends a single line-feed byte (0x0A).
fn write_line(value: String, target: OutputTarget): Output -> Result<Unit, IoError>
Writes text followed by exactly \n to the selected target.
fn write(bytes: Bytes): Output -> Result<Unit, IoError>
Writes bytes to the selected output target (stdout by default).
Use this when you need binary output instead of UTF-8 text.
fn write(bytes: Bytes, target: OutputTarget): Output -> Result<Unit, IoError>
Writes bytes to the selected output target.
fn write_bytes(bytes: Bytes): Output -> Result<Unit, IoError>
Writes bytes to the selected output target (stdout by default).
Use this when you need binary output instead of UTF-8 text.
fn write_bytes(bytes: Bytes, target: OutputTarget): Output -> Result<Unit, IoError>
Writes bytes to the selected output target.
fn flush(): Output -> Result<Unit, IoError>
Flushes the selected output target (stdout by default).
fn flush(target: OutputTarget): Output -> Result<Unit, IoError>
Flushes the selected output target.
fn is_tty(): Output -> bool
Returns true when the selected output target is a terminal (stdout by default).
fn is_tty(target: OutputTarget): Output -> bool
Returns true when the selected output target is a terminal.
Type Aliases
type OutputTarget = |(StdOut, StdErr)
Objects
obj StdOut
obj StdErr
Effects
eff Output
Host output effect used by std::output.
Operations in this effect forward writes/flushes to host-managed stdout and
stderr streams using MessagePack DTO payloads.
mod std::path
Pure path string utilities.
std::path performs lexical path composition and inspection without touching
the file system. Use std::fs when you need host-backed path existence or I/O.
Objects
obj Path
impl Path
mod std::pkg
Standard library package root exports.
This module re-exports core std modules and common types/functions for convenient
import via std::pkg.
Re-Exports
pub array
pub optional
pub result
pub prelude
pub error
pub version
pub enums
pub string
pub box
pub memory
pub msgpack
pub dict
pub subscript
pub traits
pub bytes
pub encoding
pub json
pub set
pub deque
pub error
pub log
pub time
pub random
pub env
pub fetch
pub input
pub output
pub path
pub fs
pub test
pub std::optional::types::Optional
pub std::optional::types::Option
pub std::optional::types::Some
pub std::optional::types::None
pub std::optional::fns::all
pub std::result::types::Result
pub std::result::types::Ok
pub std::result::types::Err
pub std::result::fns::all
pub std::enums::enum
pub std::array::Array
pub std::array::ArrayPop
pub std::array::new_array_unchecked
pub std::dict::Dict
pub std::dict::DictEntry
pub std::dict::DictKey
pub std::traits::Sequence
pub std::traits::Iterator
pub std::traits::for
pub std::subscript::Range
pub std::subscript::SubscriptRead
pub std::subscript::SubscriptWrite
pub std::bytes::Byte
pub std::bytes::Bytes
pub std::bytes::ByteBuffer
pub std::encoding::errors::DecodeError
pub std::string::String
pub std::string::StringSlice
pub std::string::StringIndex
pub std::string::CharSet
pub std::string::Utf8Error
pub std::string::ParseIntError
pub std::string::ParseFloatError
pub std::string::new_string
pub std::string::from_utf8
pub std::box::Box
pub std::json::JsonArray
pub std::json::JsonBool
pub std::json::JsonError
pub std::json::JsonNull
pub std::json::JsonNumber
pub std::json::JsonObject
pub std::json::JsonString
pub std::json::JsonValue
pub std::json::parse
pub std::json::stringify
pub std::json::stringify_pretty
pub std::set::Set
pub std::deque::Deque
pub std::traits::all
pub std::test::assertions::Test
pub std::test::assertions::assert
pub vx
pub math
Macros
macro ??
macro ?.
macro enum
macro for
mod std::prelude
Re-Exports
pub std::optional::types::Optional
pub std::optional::types::Option
pub std::optional::types::Some
pub std::optional::types::None
pub std::optional::fns::some
pub std::optional::fns::none
pub std::result::types::Result
pub std::result::types::Ok
pub std::result::types::Err
pub std::result::fns::ok
pub std::result::fns::err
pub std::traits::Eq
pub std::traits::Ord
pub std::traits::Hash
pub std::traits::Default
pub std::traits::Clone
pub std::traits::Copy
pub std::traits::Sequence
pub std::traits::Iterator
pub std::subscript::Range
pub std::array::Array
pub std::array::ArrayPop
pub std::array::new_array
pub std::array::new_array_unchecked
pub std::dict::Dict
pub std::dict::DictEntry
pub std::dict::DictKey
pub std::deque::Deque
pub std::set::Set
pub std::bytes::Byte
pub std::bytes::Bytes
pub std::bytes::ByteBuffer
pub std::box::Box
pub std::math
pub std::string::String
pub std::string::StringSlice
pub std::string::StringIndex
pub std::string::CharSet
pub std::string::Utf8Error
pub std::string::ParseIntError
pub std::string::ParseFloatError
pub std::string::new_string
pub std::string::from_utf8
pub std::error::panic
pub std::test::assertions::assert
mod std::random
Random-number and random-byte helpers backed by the host Random effect.
The host implementation is expected to provide cryptographically secure
randomness when available.
Functions
fn next_i64(): Random -> i64
Returns a random 64-bit integer.
fn fill_bytes(~buf: ByteBuffer, len: i32): Random -> void
Fills a byte buffer with cryptographically secure random bytes.
len controls the number of bytes appended to buf.
Example:
let buf = ByteBuffer::new()
random::fill_bytes(buf, len: 16)
buf.len() == 16
fn fill_buffer(~buf: ByteBuffer, len: i32): Random -> void
Fills a byte buffer with cryptographically secure random bytes.
fn random_bool(): Random -> bool
Returns a random boolean value.
fn random_int(range: Range): Random -> i32
Returns a random integer within the provided range.
The range lower bound is inclusive. The upper bound follows Range:
exclusive by default, inclusive when include_end is true.
Example:
random::random_int(1..6) samples values in [1, 5].
Effects
eff Random
Host-provided random source effect.
The host random provider should use a secure entropy source when available.
std::random normalizes returned values into i32 byte ranges where needed.
mod std::result
Result standard module.
Re-exports the core Result type family and functional helpers.
Re-Exports
pub types::all
pub fns::all
mod std::result::fns
Result helper functions.
Functional constructors and combinators for working with Result<T, E>.
Functions
fn ok<T, E>(value: T): () -> Result<T, E>
Constructs a successful Result value.
Use this when an operation completes with a value.
fn err<T, E>(error: E): () -> Result<T, E>
Constructs a failing Result value.
Use this when an operation cannot produce a success value.
fn is_ok<T, E>(result: Result<T, E>): () -> bool
Returns true when the result is successful.
fn is_err<T, E>(result: Result<T, E>): () -> bool
Returns true when the result is an error.
fn unwrap_or<T, E>(result: Result<T, E>, fallback: T): () -> T
Returns the contained value or a fallback.
The fallback is returned unchanged when result is Err.
fn map<T, E, U>(
result: Result<T, E>,
f: (v: T) -> U
) -> Result<U, E>
Transforms an Ok value and leaves Err unchanged.
fn and_then<T, E, U>(
result: Result<T, E>,
f: (v: T) -> Result<U, E>
) -> Result<U, E>
Chains another result-producing operation on success.
Errors are propagated without invoking f.
mod std::result::types
Result type definitions.
Contains the sum type used to represent success (Ok) or failure (Err).
Type Aliases
type Result<T, E> = |(Ok<T>, Err<E>)
Result sum type.
A value is either Ok<T> for success or Err<E> for failure.
Objects
obj Unit
Unit sentinel type used by APIs that need a concrete object shape.
obj Ok<T>
Successful Result variant.
Stores the produced value for success paths.
obj Err<E>
Failing Result variant.
Stores error information for failure paths.
mod std::set
Hash-based set collection backed by std::dict::Dict.
Values must implement DictKey so membership uses hash/equality semantics.
Objects
obj Set<T>
A hash-based set of unique values.
Example:
let ~tags = Set<String>::init()
tags.insert("alpha")
tags.contains("alpha")
impl<T> Set<T>
mod std::string
Public string module surface.
This module re-exports the core string types and parse/error helpers from
std::string::type, and provides top-level constructors for UTF-8 data.
Use this module when you want the default string APIs without importing
implementation details.
Re-Exports
pub errors::ParseFloatError
pub errors::ParseIntError
pub errors::Utf8Error
pub index::StringIndex
pub type::CharSet
pub type::String
pub type::StringSlice
Functions
fn new_string(from_bytes: FixedArray<i32>): () -> String
Builds a string from owned UTF-8 byte storage without validation.
This constructor assumes from_bytes already contains UTF-8 data.
Invalid sequences are normalized into replacement runes by the lower-level
decoder used internally.
fn from_utf8(source: Array<i32>) -> Result<String, Utf8Error>
Validates UTF-8 bytes and builds a string on success.
source: UTF-8 bytes to validate and convert.
Example:
String::from_utf8([72, 101, 108, 108, 111])
returns Ok("Hello").
mod std::string::errors
Error payloads used by std::string parsing and UTF-8 conversion APIs.
Each error currently exposes a numeric code so callers can branch on
failure kinds without string matching.
Objects
obj Utf8Error
Error returned when UTF-8 validation fails.
obj ParseIntError
Error returned when integer parsing fails.
obj ParseFloatError
Error returned when floating-point parsing fails.
mod std::string::index
String index primitives.
A StringIndex is an opaque byte offset into a UTF-8 string.
Most callers should construct and move indices through String APIs like
start_index, end_index, index, and grapheme_index.
Objects
obj StringIndex
Opaque byte index used by string traversal APIs.
impl StringIndex
mod std::string::type
Core UTF-8 string types and operations.
String is an owned UTF-8 value and StringSlice is a non-owning byte
window into a String. Index-based traversal uses StringIndex byte
offsets, with helpers that keep movement on rune or grapheme boundaries.
Type Aliases
type CharSet = Array<i32>
Rune set used by trimming and character membership APIs.
Objects
obj String
Owned UTF-8 string value.
impl String
impl String for Sequence<i32>
obj StringSlice
Non-owning view into a String byte range.
impl StringSlice
mod std::subscript
Subscript traits and range type.
Provides shared indexing contracts for read and write operations.
Objects
obj Range
Range object used by subscript-capable APIs.
Traits
trait SubscriptRead<Index, Output>
Read-only subscript contract.
trait SubscriptWrite<Index, Value>
Mutable subscript contract.
mod std::test
Re-Exports
pub assertions::all
mod std::test::assertions
Test assertion utilities.
Hosts effectful assertion helpers used by std and smoke tests.
Functions
fn assert(cond: boolean): fail -> void
Fails the current test when cond is false.
fn assert<T>(value: T, { eq expected: T }): fail -> void
Fails the current test when value is not equal to expected.
fn assert<T>(value: T, { neq expected: T }): fail -> void
Fails the current test when value is equal to expected.
Effects
eff Test
Host test-runner effect used by assertion helpers.
The runtime consumes these operations to mark test outcomes and emit test logs.
mod std::time
Time primitives and scheduling helpers backed by the host Time effect.
Includes monotonic timing (Instant), wall-clock timing (SystemTime),
duration utilities, and timer-based callbacks.
Functions
fn sleep(ms: i64): Time -> Result<Unit, HostError>
Suspends execution for the provided millisecond count.
Example: time::sleep(250).
fn sleep(duration: Duration): Time -> Result<Unit, HostError>
Suspends execution for the provided duration.
Example: time::sleep(Duration::from_secs(1)).
fn on_timeout(
duration: Duration,
callback: (()) -> void
): Time -> Result<Unit, HostError>
Schedules and runs a callback once after the provided duration.
Example: time::on_timeout(Duration::from_millis(100), || do_work()).
fn on_interval(
interval: Duration,
callback: (()) -> void
): Time -> Result<Unit, HostError>
Runs a callback repeatedly at the provided interval.
The callback runs after each successful interval wait.
Example: time::on_interval(Duration::from_secs(1), || tick()).
Objects
obj Duration
Represents a millisecond-based time span.
impl Duration
obj Instant
Monotonic timestamp that is suitable for elapsed-time measurement.
impl Instant
obj SystemTime
Wall-clock timestamp represented as milliseconds from the Unix epoch.
impl SystemTime
Effects
eff Time
Host-provided time and timer operations.
std::time encodes timer commands as MessagePack payloads and decodes host
responses into typed success/error values.
mod std::traits
Core standard traits.
Re-exports shared behavior contracts used throughout the language and std.
Re-Exports
pub sequence::Sequence
pub sequence::Iterator
pub sequence::for
pub eq::Eq
pub ord::Ord
pub ord::Ordering
pub ord::Less
pub ord::Equal
pub ord::Greater
pub hash::Hash
pub hash::Hasher
pub default::Default
pub clone::Clone
pub clone::Copy
pub convert::From
pub convert::Into
pub convert::TryFrom
pub convert::TryInto
pub collect::Collect
Macros
macro for
mod std::traits::clone
Value duplication traits.
Clone supports explicit duplication, while Copy marks cheap copy semantics.
Traits
trait Clone<T>
Trait for creating an explicit duplicate of a value.
trait Copy<T>
Trait for values that can be copied without ownership transfer concerns.
mod std::traits::collect
Collection construction traits.
Provides conversions from sequences into concrete collection types.
Traits
trait Collect<T>
Trait for creating a value from a sequence of items.
mod std::traits::convert
Conversion traits.
Provides infallible and fallible conversion contracts.
Traits
trait From<To, From>
Infallible conversion into To from From.
trait Into<From, To>
Infallible conversion from From into To.
trait TryFrom<To, From, E>
Fallible conversion into To from From.
trait TryInto<From, To, E>
Fallible conversion from From into To.
mod std::traits::default
Traits
trait Default<T>
Trait for producing a default instance of a type.
mod std::traits::eq
Traits
trait Eq<T>
Trait for checking equality between two values of the same type.
mod std::traits::hash
Hashing traits.
Defines writer and value hashing contracts used by hash-based collections.
Traits
trait Hasher
Trait implemented by hash state writers.
trait Hash<T>
Trait for values that can feed bytes into a hasher.
mod std::traits::ord
Ordering trait and ordering marker types.
Defines total ordering comparisons and relational operator overloads.
Type Aliases
type Ordering = |(Less, |(Equal, Greater))
Union type representing a comparison result.
Objects
obj Less
Marker for values less than the compared value.
obj Equal
Marker for values equal to the compared value.
obj Greater
Marker for values greater than the compared value.
Traits
trait Ord<T>
Trait for total ordering between values.
mod std::traits::sequence
Sequence and iterator traits.
Defines iteration contracts and the for macro expansion used by the language.
Macros
macro for
Traits
trait Sequence<T>
Trait for values that can produce iterators.
trait Iterator<T>
Trait for stateful iterators over T values.
mod std::version
Version metadata for the standard library package.
Functions
fn std_version() -> String
Returns the version of the standard library package.
fn language_version() -> String
Returns the language version this standard library targets.
mod std::vx
Virtual DOM helpers.
Utilities for constructing VX element payloads encoded as MsgPack maps.
Functions
fn create_element(
{
name: String
attributes?: Array<Array<MsgPack>>
children: Array<MsgPack>
}
) -> MsgPack
Creates a virtual DOM element payload for renderer consumption.
The returned value is a MsgPack map with name, children, and optional attributes.