Table of Contents
modstd::arrayFunctions: 2 | Objects: 2 | Implementations: 6modstd::asyncRe-Exports: 1modstd::async::typesType Aliases: 1 | Objects: 1modstd::boxObjects: 1modstd::bytesType Aliases: 1 | Objects: 2 | Implementations: 2modstd::dataFunctions: 10 | Type Aliases: 5 | Objects: 43 | Traits: 4 | Implementations: 4modstd::dequeObjects: 1 | Implementations: 1modstd::dictObjects: 3 | Traits: 1 | Implementations: 6modstd::encodingRe-Exports: 5modstd::encoding::asciiFunctions: 1modstd::encoding::base64Functions: 3modstd::encoding::errorsFunctions: 3 | Objects: 1modstd::encoding::hexFunctions: 3modstd::enumsMacros: 1modstd::envFunctions: 8 | Objects: 3 | Effects: 1modstd::errorFunctions: 3 | Type Aliases: 1 | Objects: 7 | Traits: 1modstd::fsFunctions: 16 | Objects: 5 | Effects: 1modstd::httpRe-Exports: 3 | Functions: 4 | Type Aliases: 3 | Objects: 8 | Implementations: 6modstd::http::clientFunctions: 14 | Type Aliases: 1 | Objects: 4 | Effects: 1 | Implementations: 2modstd::http::serverFunctions: 12 | Objects: 10 | Effects: 3 | Implementations: 5modstd::http::wireFunctions: 9 | Objects: 5modstd::inputFunctions: 6 | Objects: 4 | Effects: 1 | Implementations: 1modstd::jsonFunctions: 20 | Type Aliases: 3 | Objects: 16 | Implementations: 4modstd::logFunctions: 20 | Type Aliases: 3 | Objects: 11 | Effects: 1modstd::mathRe-Exports: 10modstd::math::constantsModule Lets: 14 | Functions: 4modstd::math::errorsFunctions: 4 | Objects: 1modstd::math::floatFunctions: 46modstd::math::intFunctions: 19modstd::math::interpolateFunctions: 28modstd::memoryFunctions: 9modstd::metaFunctions: 2 | Type Aliases: 1 | Objects: 16modstd::msgpackRe-Exports: 12 | Functions: 31 | Type Aliases: 1modstd::msgpack::errorsObjects: 1modstd::msgpack::fnsObjects: 3 | Implementations: 4modstd::msgpack::typesType Aliases: 1 | Objects: 7modstd::numberRe-Exports: 2modstd::number::castFunctions: 32 | Objects: 3 | Implementations: 1modstd::optionalRe-Exports: 2 | Macros: 2modstd::optional::fnsMacros: 2 | Functions: 10modstd::optional::typesType Aliases: 2 | Objects: 2modstd::outputFunctions: 20 | Type Aliases: 1 | Objects: 6 | Effects: 1modstd::pathObjects: 1 | Implementations: 1modstd::pkgRe-Exports: 92 | Macros: 4modstd::preludeRe-Exports: 50 | Macros: 3modstd::randomFunctions: 15 | Objects: 5 | Effects: 1 | Implementations: 2modstd::rangeObjects: 1 | Implementations: 1modstd::resultRe-Exports: 2modstd::result::fnsFunctions: 7modstd::result::typesType Aliases: 1 | Objects: 3modstd::setObjects: 1 | Implementations: 1modstd::shared_cellType Aliases: 1 | Objects: 1 | Implementations: 1modstd::stringRe-Exports: 7 | Functions: 2modstd::string::indexObjects: 1 | Implementations: 1modstd::string::typeType Aliases: 1 | Objects: 5 | Implementations: 5modstd::subscriptTraits: 2modstd::taskFunctions: 6 | Type Aliases: 1 | Objects: 2 | Effects: 1 | Implementations: 2modstd::testRe-Exports: 1modstd::test::assertionsFunctions: 3 | Effects: 1modstd::timeFunctions: 13 | Objects: 6 | Effects: 1 | Implementations: 4modstd::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::vxRe-Exports: 3 | Functions: 190 | Type Aliases: 21 | Objects: 10 | Effects: 1 | Implementations: 8modstd::vx::canvasFunctions: 27 | Type Aliases: 3 | Objects: 6 | Implementations: 8modstd::vx::commandObjects: 2 | Implementations: 1
mod std::array
Growable contiguous arrays with isolated copy operations.
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.
impl Array<i32>
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<i32>, Array<T>>
impl<T> Array<T> for SubscriptWrite<i32, T>
obj ArrayPop<T>
Result payload returned by Array::popped.
mod std::async
Re-Exports
pub types::all
mod std::async::types
Async completion type definitions.
Defines the shared completion vocabulary for values that may become ready later.
Type Aliases
type Completion<T, E> = |(Result<T, E>, Cancelled)
Cancellation-aware completion alias.
Async work completes with either a success value, an error, or cancellation.
Objects
obj Cancelled
Completion variant for work cancelled before producing a value or error.
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::data
Neutral dynamic values and checked structural decoding.
Wire-format packages translate their own values to DataValue; the
compiler-generated boundary codec performs the final typed conversion only
after this module validates the matching provider-neutral Shape.
Functions
fn default_encode_limits() -> EncodeLimits
Returns conservative default encoding limits.
fn default_decode_limits() -> DecodeLimits
Returns conservative default decoding limits.
fn default_decode_options() -> DecodeOptions
Returns decoder options that reject unknown fields.
fn encode<T>(value: T): () -> DataValue
Encodes a DTO-compatible value into the neutral dynamic tree.
fn write<T, SinkError, Writer>(writer: Writer, value: T): () -> Result<Unit, SinkError>
Writes a closed DTO directly into a stateful provider sink.
The compiler generates the schema traversal. The sink receives compact
record and variant descriptors without an intermediate DataValue tree.
fn read<T, SourceError, Reader>(
reader: Reader,
reject_unknown_fields: bool
): () -> Result<T, SourceError>
Reads a closed DTO directly from a stateful provider source.
fn decode<T>(value: DataValue): () -> Result<T, DecodeError>
Fallibly decodes a neutral value into a boundary-compatible Voyd type.
fn decode<T>(value: DataValue, { options: DecodeOptions }): () -> Result<T, DecodeError>
Fallibly decodes with an explicit unknown-field policy.
fn string_value(value: String) -> DataValue
Constructs a neutral string value from owned text.
fn string_value(value: StringSlice) -> DataValue
Constructs a neutral string value from a slice.
Type Aliases
type DataValue = |(|(|(|(|(|(|(|(|(|(DataNull, DataBool), DataI32), DataI64), DataF32), DataF64), DataString), DataBytes), DataArray), DataObject), DataVariant)
Provider-neutral dynamic value accepted by structural codecs.
type UnknownFieldPolicy = |(IgnoreUnknownFields, RejectUnknownFields)
Policy for fields not present in a target record or variant.
type DataKind = |(|(|(|(|(|(|(|(|(|(NullKind, BoolKind), I32Kind), I64Kind), F32Kind), F64Kind), StringKind), BytesKind), ArrayKind), RecordKind), VariantKind)
Provider-neutral kinds reported by a DataReader.
type DataValueReadErrorKind = |(DataValueSourceFailure, DataValueCustomFailure)
type DecodeErrorKind = |(|(|(|(|(|(MissingField, UnknownField), TypeMismatch), DuplicateField), InvalidVariant), InvalidShapeReference), CustomDtoFailure)
Stable categories of structural decode failures.
Objects
obj DataNull
Neutral null/unit value.
obj DataBool
Neutral boolean value.
obj DataI32
Neutral signed 32-bit integer value.
obj DataI64
Neutral signed 64-bit integer value.
obj DataF32
Neutral 32-bit floating-point value.
obj DataF64
Neutral 64-bit floating-point value.
obj DataString
Neutral owned string value.
obj DataBytes
Neutral immutable byte sequence.
obj DataField
Named field in a neutral object or variant payload.
obj DataArray
Neutral ordered array value.
obj DataObject
Neutral string-keyed object value.
obj DataVariant
Neutral named variant value.
obj CustomDtoError
Validation failure reported by a custom DTO representation.
obj IgnoreUnknownFields
Ignore object fields absent from the target Voyd type.
obj RejectUnknownFields
Reject object fields absent from the target Voyd type.
obj DecodeOptions
Structural decoder configuration.
obj EncodeLimits
Resource limits applied while writing a DTO value.
obj DecodeLimits
Resource limits applied before allocating decoded DTO storage.
obj NullKind
obj BoolKind
obj I32Kind
obj I64Kind
obj F32Kind
obj F64Kind
obj StringKind
obj BytesKind
obj ArrayKind
obj RecordKind
obj VariantKind
obj DataValueWriteError
Balanced-stream error reported by DataValueWriter.
obj DataValueWriter
Concrete balanced writer that constructs one explicit DataValue tree.
impl DataValueWriter
impl DataValueWriter for DataWriter<DataValueWriteError>
obj DataValueSourceFailure
obj DataValueCustomFailure
obj DataValueReadError
Pull-stream error reported by DataValueReader.
obj DataValueReader
Concrete pull reader over one explicit DataValue tree.
impl DataValueReader
impl DataValueReader for DataReader<DataValueReadError>
obj MissingField
A required field was absent.
obj UnknownField
A field was not declared by the target shape.
obj TypeMismatch
A dynamic value had the wrong kind.
obj DuplicateField
An object or variant payload repeated a field name.
obj InvalidVariant
A union value named an unsupported variant.
obj InvalidShapeReference
A shape reference could not be resolved.
obj CustomDtoFailure
A custom DTO rejected its otherwise valid representation.
obj DecodeError
Precise, recoverable structural decode failure.
Traits
trait CustomDto<T, Representation>
One provider-neutral external representation for an exceptional nominal type.
Representation must itself be eligible for automatic DTO derivation.
Implementations are format-independent and singular for T.
trait HostTransportProvider<Reader, Writer>
Compiler-known lifecycle for a stateless host transport provider.
trait DataWriter<SinkError>
Stateful sink used by generated DTO traversal.
Calls must form one balanced root value. A writer becomes unusable after
the first sink failure.
trait DataReader<SourceError>
Stateful pull source used by generated DTO traversal.
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 DictEntryRemove<K, V>
Result of removing a value through a dictionary entry.
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).
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
Encoding-specific decode error definitions.
Functions
fn decode_error_invalid_length(message: String): () -> DecodeError
fn decode_error_invalid_character(message: String): () -> DecodeError
fn decode_error_invalid_padding(message: String): () -> DecodeError
Objects
obj 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_bool(key: String): Env -> Option<bool>
Reads an environment variable and parses it as a boolean.
fn get_bool(key: StringSlice): Env -> Option<bool>
fn get_int(key: String): Env -> Option<i32>
Reads an environment variable and parses it as a 32-bit integer.
fn get_int(key: StringSlice): Env -> Option<i32>
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>
Objects
obj EnvGetResult
Host environment effect used by std::env.
obj EnvSetRequest
obj EnvSetResult
Effects
eff Env
Operations in this effect mirror host process environment APIs and exchange
automatic DTO values.
mod std::error
Shared runtime and host error definitions for the standard library.
Domain-specific parse and codec errors live with their owning modules.
std::error only defines cross-cutting runtime failures plus panic support.
Functions
fn panic(message: String) -> void
Stops execution immediately with a panic.
When host/runtime diagnostics are available, the panic message is preserved
so runtimes can surface human-readable failure context instead of a bare trap.
fn panic(message: StringSlice) -> void
fn panic() -> void
Stops execution immediately without allocating a diagnostic message.
Type Aliases
type IoErrorKind = |(|(|(|(IoNotFound, IoAlreadyExists), IoPermissionDenied), IoConflict), IoOther)
Portable categories for host I/O failures.
Objects
obj HostError
obj IoNotFound
A filesystem path was not found.
obj IoAlreadyExists
A create-only operation targeted an existing path.
obj IoPermissionDenied
The host denied access to the requested operation.
obj IoConflict
The path is temporarily unavailable because of a filesystem conflict.
obj IoOther
The host reported an I/O failure without a more portable category.
obj IoError
Traits
trait Error<T>
mod std::fs
File system APIs backed by host runtime operations.
std::fs provides read/write/existence/removal/listing helpers that operate on
std::path::Path and return typed Result values where host I/O can fail.
Effect payloads use automatic DTO conversion.
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_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_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 remove(path: Path): Fs -> Result<Unit, IoError>
Removes a file or empty directory.
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.
fn create_dir_all(path: Path): Fs -> Result<Unit, IoError>
Creates a directory and all missing parent directories.
Existing directories are accepted as success.
fn rename(source: Path, { to destination: Path }): Fs -> Result<Unit, IoError>
Renames a file or directory from source to destination.
Host filesystem rename semantics apply. Renaming a temporary file over its
destination can be used for atomic replacement when both paths share a
filesystem.
fn write_atomic(path: Path, bytes: Bytes): Fs -> Result<Unit, IoError>
Atomically writes bytes, replacing the destination only after the complete
value has been written to a temporary file in the same directory.
A successful call guarantees that readers see either the previous complete
file or the new complete file. Host and operating-system durability after a
process or machine crash is outside this contract.
fn write_atomic(path: Path, value: String): Fs -> Result<Unit, IoError>
Atomically writes owned UTF-8 text. See the bytes overload for replacement
and durability guarantees.
fn write_atomic(path: Path, value: StringSlice): Fs -> Result<Unit, IoError>
Atomically writes borrowed UTF-8 text.
fn create_exclusive(path: Path, bytes: Bytes): Fs -> Result<Unit, IoError>
Creates and writes a new file atomically with respect to competing creators.
Returns IoAlreadyExists when another writer owns the destination.
fn create_exclusive(path: Path, value: String): Fs -> Result<Unit, IoError>
Creates and writes a new UTF-8 text file atomically with respect to competing
creators.
fn create_exclusive(path: Path, value: StringSlice): Fs -> Result<Unit, IoError>
Creates and writes a borrowed UTF-8 text file atomically with respect to
competing creators.
Objects
obj FsResult<T>
Host file-system effect used by std::fs.
obj FsWriteBytesRequest
obj FsWriteStringRequest
obj FsWriteRequest
obj FsRenameRequest
Effects
eff Fs
Operations in this effect proxy host file APIs using automatic DTO values.
mod std::http
Shared HTTP protocol values and helpers.
std::http is pure: it defines methods, statuses, headers, bodies,
inbound requests, and responses used by client and server effects.
Re-Exports
pub client
pub server
pub wire
Functions
fn method(value: StringSlice) -> Method
Parses a standard HTTP method or preserves an extension method.
fn method(value: String) -> Method
Parses a standard HTTP method or preserves an extension method.
fn method_as_string(value: Method) -> String
Returns the method token as a string.
fn headers() -> Headers
Creates an empty header collection.
Type Aliases
type Method = |(|(|(|(|(|(|(|(|(Get, Head), Post), Put), Patch), Delete), Options), Trace), Connect), Other)
type Header = object_literal(name: HeaderName, value: String)
type RequestTarget = |(Origin, Absolute)
Objects
obj Status
impl Status
obj HeaderName
impl HeaderName
obj Headers
impl Headers
obj Body
impl Body
obj QueryString
obj IncomingRequest
impl IncomingRequest
obj Response
impl Response
obj HttpError
mod std::http::client
Host-backed outbound HTTP client capability.
Requests are built with typed HTTP values and cross the host boundary as
provider-neutral automatic DTOs.
Functions
fn send(request: ClientRequest): HttpClient -> Result<Response, HostError>
Sends a prebuilt request.
fn request(request: ClientRequest): HttpClient -> Result<Response, HostError>
Alias for send.
fn get(url: StringSlice): HttpClient -> Result<Response, HostError>
Sends a GET request.
fn get(url: String): HttpClient -> Result<Response, HostError>
Sends a GET request.
fn head(url: StringSlice): HttpClient -> Result<Response, HostError>
Sends a HEAD request.
fn head(url: String): HttpClient -> Result<Response, HostError>
Sends a HEAD request.
fn delete(url: StringSlice): HttpClient -> Result<Response, HostError>
Sends a DELETE request.
fn delete(url: String): HttpClient -> Result<Response, HostError>
Sends a DELETE request.
fn post(
{
url: StringSlice
body: Body
}
): HttpClient -> Result<Response, HostError>
Sends a POST request.
fn post(
{
url: String
body: Body
}
): HttpClient -> Result<Response, HostError>
Sends a POST request.
fn put(
{
url: StringSlice
body: Body
}
): HttpClient -> Result<Response, HostError>
Sends a PUT request.
fn put(
{
url: String
body: Body
}
): HttpClient -> Result<Response, HostError>
Sends a PUT request.
fn patch(
{
url: StringSlice
body: Body
}
): HttpClient -> Result<Response, HostError>
Sends a PATCH request.
fn patch(
{
url: String
body: Body
}
): HttpClient -> Result<Response, HostError>
Sends a PATCH request.
Type Aliases
type RedirectPolicy = |(|(Follow, Manual), Error)
Objects
obj ClientRequest
impl ClientRequest
obj RequestOptions
impl RequestOptions
obj RedirectPolicyDto
obj ClientRequestDto
Effects
eff HttpClient
Host HTTP client effect.
mod std::http::server
Host-backed inbound HTTP server capability.
The low-level API exposes explicit listen/accept/respond/close lifecycle
operations. serve_each provides a small safe request loop with an explicit
request task policy.
Functions
fn listen(config: ServerConfig): HttpServer -> Result<Server, HostError>
Starts a host HTTP server.
fn accept(server: Server): HttpServer -> Result<PendingRequest, HostError>
Accepts the next pending request.
fn accept_streaming(
server: Server
): HttpServer -> Result<StreamingPendingRequest, HostError>
Accepts a request whose body can be consumed incrementally.
Configure the server with stream_request_bodies: true to avoid buffering
in the host. Buffered hook implementations remain compatible and are
exposed as the reader's first chunk.
fn respond(
handle: RequestHandle,
response: ::(http, Response)
): HttpServer -> Result<Unit, HostError>
Responds to one pending request.
fn start_response(
handle: RequestHandle,
response: ::(http, Response)
): HttpServer -> Result<Unit, HostError>
Starts a response without ending its body.
fn write_response(
handle: RequestHandle,
chunk: Bytes
): HttpServer -> Result<Unit, HostError>
Writes a chunk to an open response stream with host backpressure.
fn finish_response(handle: RequestHandle): HttpServer -> Result<Unit, HostError>
Finishes an open response stream.
fn stream(
response: ::(http, Response),
{
body: fn: (ResponseWriter, open) -> void
}
): (ResponseStream, open) -> ::(http, Response)
Produces a streaming response from an ordinary Web handler.
The enclosing server loop binds the stream to the current request. Calling
this outside serve_each leaves ResponseStream visible to the caller.
fn write(chunk: Bytes): ResponseWriter -> Result<Unit, HostError>
Writes one byte chunk from a streaming response producer.
fn close(server: Server): HttpServer -> Result<Unit, HostError>
Closes a server.
fn serve_each(
{
config: ServerConfig
policy: ServeTaskPolicy
handle: fn(::(http, IncomingRequest)): (open) -> ::(http, Response)
}
): (HttpServer, ::(task, TaskRuntime), open) -> Result<Unit, HostError>
Listens and handles each accepted request according to policy.
Each accepted request is responded to exactly once by this helper. Sequential
policy returns accept/respond host errors directly. Detached policy reports
per-request respond failures through the task runtime's detached failure
diagnostics and keeps accepting new requests.
fn serve_each_streaming(
{
config: ServerConfig
policy: ServeTaskPolicy
handle: fn(::(http, IncomingRequest), RequestBody): (open) -> ::(http, Response)
}
): (HttpServer, ::(task, TaskRuntime), open) -> Result<Unit, HostError>
Listens and handles requests with lazily consumed request bodies.
Set config.stream_request_bodies to true so the host accepts requests
after their headers arrive. The handler receives the request head and a
backpressure-aware body reader separately.
Objects
obj Server
impl Server
obj RequestHandle
impl RequestHandle
obj ServerConfig
impl ServerConfig
obj PendingRequest
obj StreamingPendingRequest
A request accepted with a lazily read body.
obj RequestBody
Backpressure-aware request body reader.
impl RequestBody
obj ServeTaskPolicy
impl ServeTaskPolicy
obj ServerConfigDto
obj RespondRequestDto
obj ChunkRequestDto
Effects
eff ResponseStream
Dynamically scoped response-stream request used by stream.
eff ResponseWriter
Dynamically scoped writer available while a response stream is open.
eff HttpServer
Host HTTP server effect.
mod std::http::wire
Provider-neutral DTOs for standard HTTP host effects.
Functions
fn decode_result<T>(result: HttpResult<T>) -> Result<T, HostError>
fn encode_result<T>(result: Result<T, HostError>, fallback: T) -> HttpResult<T>
fn encode_headers(headers: Headers) -> Array<HeaderDto>
fn decode_headers(source: Array<HeaderDto>) -> Result<Headers, HostError>
fn encode_response(response: Response) -> ResponseDto
fn decode_response(value: ResponseDto) -> Result<Response, HostError>
fn decode_response_result(result: HttpResult<ResponseDto>) -> Result<Response, HostError>
fn decode_pending_request_result(
result: HttpResult<PendingRequestDto>
) -> Result<(i32, IncomingRequest, bool), HostError>
fn body_from_bytes(bytes: Bytes) -> Body
Objects
obj HttpResult<T>
obj HeaderDto
obj ResponseDto
obj PendingRequestDto
obj RequestChunkDto
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 use automatic DTO conversion.
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
obj InputReadBytesRequest
obj InputLineResult
obj InputBytesResult
Effects
eff Input
Host input effect used by std::input.
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. Stringification is fallible because JSON
numbers must be finite.
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) -> Result<String, JsonError>
Serializes a JsonValue to compact JSON text.
Params:
value: JSON value to serialize.
Returns Err(JsonError) when serialization would produce invalid JSON, such
as a JsonNumber containing NaN or infinity.
Example:
use std::json
let text = json::stringify(JsonBool { value: true })fn stringify_pretty(value: JsonValue) -> Result<String, JsonError>
Serializes a JsonValue to pretty JSON text with indentation.
Params:
value: JSON value to serialize.
Returns Err(JsonError) when serialization would produce invalid JSON.
fn strict_decode_options() -> JsonDecodeOptions
Returns strict typed-decoder options that reject unknown record fields.
fn permissive_decode_options() -> JsonDecodeOptions
Returns forward-compatible typed-decoder options that ignore unknown fields.
fn encode<T>(value: T): () -> Result<String, JsonError>
Encodes a DTO-compatible value as compact JSON text.
Signed 64-bit integers outside JavaScript's exact integer range are
rejected. Bytes requires an explicit application representation.
fn encode_with_limits<T>(
value: T,
{
limits: EncodeLimits
}
): () -> Result<String, JsonError>
Encodes compact JSON with explicit depth, byte, and collection limits.
fn encode_value<T>(value: T): () -> Result<JsonValue, JsonError>
Encodes a DTO-compatible value as an explicit JSON value tree.
Use this when an API needs to inspect or compose JSON before stringifying it.
fn decode<T>(source: String): () -> Result<T, JsonDecodeError>
Parses and strictly decodes JSON into a closed boundary-compatible type.
fn decode<T>(source: StringSlice): () -> Result<T, JsonDecodeError>
Parses and strictly decodes a borrowed JSON source.
fn decode<T>(
source: String,
{
options: JsonDecodeOptions
}
): () -> Result<T, JsonDecodeError>
Parses and decodes JSON with an explicit unknown-field policy.
fn decode<T>(
source: StringSlice,
{
options: JsonDecodeOptions
}
): () -> Result<T, JsonDecodeError>
Parses and decodes borrowed JSON with an explicit unknown-field policy.
fn decode<T>(value: JsonValue): () -> Result<T, JsonDecodeError>
Strictly decodes an already-parsed JSON value.
fn decode<T>(
value: JsonValue,
{
options: JsonDecodeOptions
}
): () -> Result<T, JsonDecodeError>
Decodes an already-parsed JSON value with explicit field policy.
fn decode_versioned<T>(
source: String,
{
current current_version: i32
migrate: JsonMigration
}
): () -> Result<T, JsonDecodeError>
Decodes a versioned document and requires migrations to produce current.
fn decode_versioned<T>(
source: StringSlice,
{
current current_version: i32
migrate: JsonMigration
}
): () -> Result<T, JsonDecodeError>
Decodes a borrowed versioned document with explicit migration dispatch.
fn decode_versioned<T>(
document: JsonValue,
{
current current_version: i32
migrate: JsonMigration
}
): () -> Result<T, JsonDecodeError>
Decodes an already-parsed versioned document with explicit migration dispatch.
fn number_in_range(
value: JsonValue,
{
at path: String
min: f64
max: f64
}
): () -> Result<f64, JsonDecodeError>
Reads a JSON number and enforces an inclusive finite range.
fn number_in_range(
value: JsonValue,
{
at path: StringSlice
min: f64
max: f64
}
): () -> Result<f64, JsonDecodeError>
Reads a ranged JSON number using a borrowed path.
Type Aliases
type JsonDecodeErrorKind = |(|(|(|(JsonParseFailure, JsonSchemaFailure), JsonVersionFailure), JsonConstraintFailure), JsonCustomDtoFailure)
Stable categories for typed JSON decoding failures.
type JsonMigration = (fn(version: i32, document: JsonValue)) -> Result<JsonValue, JsonDecodeError>
Migration callback for a parsed versioned document.
type JsonValue = |(JsonNull, |(JsonBool, |(JsonNumber, |(JsonString, |(JsonArray, JsonObject)))))
Tagged union over all supported JSON value variants.
Objects
obj JsonError
obj JsonWriter
Direct compact-JSON sink used by compiler-generated DTO traversal.
impl JsonWriter
impl JsonWriter for DataWriter<JsonError>
obj JsonParseFailure
The JSON text itself was malformed.
obj JsonSchemaFailure
A parsed value did not match the requested Voyd type.
obj JsonVersionFailure
A versioned document could not be dispatched or migrated.
obj JsonConstraintFailure
A decoded number violated an explicit application constraint.
obj JsonCustomDtoFailure
A custom DTO rejected a valid JSON representation.
obj JsonDecodeError
Typed JSON failure with a rooted JSON path and retained cause text.
obj JsonDecodeOptions
Unknown-field behavior used by typed JSON decoding.
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.
obj JsonReader
Pull reader over one JSON source without constructing a JsonValue tree.
impl JsonReader
impl JsonReader for DataReader<JsonError>
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
obj LogEvent
Effects
eff Log
Host logging effect used by std::log.
std::log sends a typed event to 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.
Module Lets
let PI
Archimedes' constant (Ï€) as f64.
let PI_F32: f32
Archimedes' constant (Ï€) as f32.
let TAU
Tau (2Ï€) as f64.
let TAU_F32: f32
Tau (2Ï€) as f32.
let E
Euler's number (e) as f64.
let E_F32: f32
Euler's number (e) as f32.
let INFINITY
Positive infinity as f64.
let INFINITY_F32: f32
Positive infinity as f32.
let NEG_INFINITY
Negative infinity as f64.
let NEG_INFINITY_F32: f32
Negative infinity as f32.
let NAN
Not-a-number as f64.
let NAN_F32: f32
Not-a-number as f32.
let EPSILON
Difference between 1.0 and the next representable f64.
let EPSILON_F32: f32
Difference between 1.0 and the next representable f32.
Functions
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
Clamps value into the inclusive range formed by min and max.
The bounds are normalized first, so callers do not need to pre-sort them.
fn clamp(
value: i32,
{
min: i32
max: i32
}
) -> i32
fn clamp(value: i64, min: i64, max: i64) -> i64
fn clamp(
value: i64,
{
min: i64
max: i64
}
) -> i64
fn clamp(value: f32, min: f32, max: f32) -> f32
fn clamp(
value: f32,
{
min: f32
max: f32
}
) -> f32
fn clamp(value: f64, min: f64, max: f64) -> f64
fn clamp(
value: f64,
{
min: f64
max: f64
}
) -> f64
fn between(value: i32, min: i32, max: i32) -> bool
Returns whether value lies inside the inclusive range formed by min and max.
fn between(
value: i32,
{
min: i32
max: i32
}
) -> bool
fn between(value: i64, min: i64, max: i64) -> bool
fn between(
value: i64,
{
min: i64
max: i64
}
) -> bool
fn between(value: f32, min: f32, max: f32) -> bool
fn between(
value: f32,
{
min: f32
max: f32
}
) -> bool
fn between(value: f64, min: f64, max: f64) -> bool
fn between(
value: f64,
{
min: f64
max: f64
}
) -> bool
fn lerp(start: f64, end: f64, t: f64) -> f64
Returns the linear interpolation between start and end at t.
t = 0 yields start, t = 1 yields end, and values outside that range
extrapolate. Supports UFCS call style: 0.0.lerp(10.0, 0.25).
fn lerp(
start: f64,
{
to end: f64
at t: f64
}
) -> f64
fn lerp(start: f32, end: f32, t: f32) -> f32
fn lerp(
start: f32,
{
to end: f32
at t: f32
}
) -> f32
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.
Values outside the range produce progress below 0 or above 1. Supports
UFCS call style: 5.0.inverse_lerp(0.0, 10.0).
fn inverse_lerp(
value: f64,
{
start: f64
end: f64
}
) -> f64
fn inverse_lerp(value: f32, start: f32, end: f32) -> f32
fn inverse_lerp(
value: f32,
{
start: f32
end: f32
}
) -> f32
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.
This is equivalent to lerp(out_min, out_max, inverse_lerp(value, in_min, in_max)).
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
fn map_range(value: f32, in_min: f32, in_max: f32, out_min: f32, out_max: f32) -> f32
fn map_range(
value: f32,
{
in_min: f32
in_max: f32
out_min: f32
out_max: f32
}
) -> f32
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::meta
Provider-neutral reification of boundary-compatible Voyd types.
Shape is a stable runtime graph. It describes Voyd structure without
exposing compiler type ids or a schema dialect such as JSON Schema.
Functions
fn shape_of<T>() -> Shape
Reifies a closed boundary-compatible type as a portable runtime graph.
Unsupported or unresolved type arguments produce a compile-time diagnostic.
fn try_shape_of<T>() -> Option<Shape>
Reifies a boundary-compatible type, or returns None when no honest shape exists.
Type Aliases
type ShapeNode = |(|(|(|(|(|(|(|(|(|(|(BoolShape, I32Shape), I64Shape), F32Shape), F64Shape), StringShape), BytesShape), UnitShape), ArrayShape), RecordShape), UnionShape), RefShape)
One node in a portable shape graph.
Objects
obj Shape
A complete portable type graph.
obj ShapeDefinition
A named node used to close recursive shape graphs.
obj BoolShape
Boolean primitive shape.
obj I32Shape
Signed 32-bit integer primitive shape.
obj I64Shape
Signed 64-bit integer primitive shape.
obj F32Shape
32-bit floating-point primitive shape.
obj F64Shape
64-bit floating-point primitive shape.
obj StringShape
String primitive shape.
obj BytesShape
Immutable byte sequence shape.
obj UnitShape
Void/unit boundary shape.
obj ArrayShape
Growable-array shape.
obj ShapeField
Field in a record or variant payload.
obj RecordShape
Record or structural-object shape.
obj ShapeVariant
One supported named union variant.
obj UnionShape
Named union/variant shape.
obj RefShape
Reference to a named entry in Shape::definitions.
mod std::msgpack
Public MessagePack API surface for constructing values and encoding/decoding
them at the Wasm memory boundary.
make_ functions construct typed MessagePack values, unpack_ functions
validate and extract native values, and encode_value / decode_value
bridge MessagePack bytes across linear memory.
Re-Exports
pub fns::MsgPackMap
pub fns::MsgPackReader
pub fns::MsgPackWriter
pub errors::MsgPackError
pub types::Binary
pub types::Bool
pub types::F32
pub types::F64
pub types::I32
pub types::I64
pub types::Null
pub types::Numeric
Functions
fn make_null(): () -> MsgPack
Constructs the MessagePack null value.
fn make_bool(value: bool): () -> MsgPack
fn make_string(value: String): () -> MsgPack
Constructs a MessagePack string from owned text.
fn make_string(value: StringSlice): () -> MsgPack
Shorthand for make_string(value.to_string()).
fn make_binary(value: Binary): () -> MsgPack
fn make_array(value: Array<MsgPack>): () -> MsgPack
Constructs a MessagePack array from an existing sequence of values.
fn make_f32(value: f32): () -> MsgPack
fn make_f64(value: f64): () -> MsgPack
fn make_i32(value: i32): () -> MsgPack
fn make_i64(value: i64): () -> MsgPack
fn make_map(value: Dict<String, MsgPack>): () -> MsgPack
Constructs a MessagePack map from string keys to values.
fn encode<T>(value: T): () -> Result<Bytes, MsgPackError>
Encodes a DTO-compatible value into immutable MessagePack bytes.
fn encode_with_limits<T>(
value: T,
{
limits: EncodeLimits
}
): () -> Result<Bytes, MsgPackError>
Encodes with explicit depth, byte, and collection limits.
fn encode_value_bytes(value: MsgPack): () -> Result<Bytes, MsgPackError>
Encodes an explicitly constructed MessagePack value into immutable bytes.
fn decode<T>(bytes: Bytes): () -> Result<T, MsgPackError>
Decodes immutable MessagePack bytes into a DTO-compatible value.
fn decode_with_limits<T>(
bytes: Bytes,
{
limits: DecodeLimits
}
): () -> Result<T, MsgPackError>
Decodes with explicit depth, byte, and collection limits.
fn decode_value_bytes(bytes: Bytes): () -> Result<MsgPack, MsgPackError>
Decodes immutable bytes into the parsed MessagePack value tree.
fn from_data_value(value: DataValue): () -> MsgPack
Converts a provider-neutral dynamic value into the parsed MessagePack tree.
fn to_data_value(value: MsgPack): () -> DataValue
Converts a parsed MessagePack tree into a provider-neutral dynamic value.
fn unpack_bool(value: MsgPack): () -> Result<bool, MsgPackError>
fn unpack_string(value: MsgPack): () -> Result<String, MsgPackError>
fn unpack_binary(value: MsgPack): () -> Result<Binary, MsgPackError>
fn unpack_array(value: MsgPack): () -> Result<Array<MsgPack>, MsgPackError>
fn unpack_f32(value: MsgPack): () -> Result<f32, MsgPackError>
Extracts an f32, accepting both MessagePack f32 and f64 values.
fn unpack_f64(value: MsgPack): () -> Result<f64, MsgPackError>
Extracts an f64, accepting both MessagePack f32 and f64 values.
fn unpack_i32(value: MsgPack): () -> Result<i32, MsgPackError>
Extracts an i32, rejecting values that overflow that range.
fn unpack_i64(value: MsgPack): () -> Result<i64, MsgPackError>
fn unpack_map(value: MsgPack): () -> Result<Dict<String, MsgPack>, MsgPackError>
Extracts a string-keyed map.
fn encode_value(value: MsgPack, ptr: i32, len: i32): () -> Result<i32, MsgPackError>
Encodes value into the caller-provided memory region [ptr, ptr + len).
Returns the number of bytes written, or Err(MsgPackError) when the region
is too small for the encoded payload.
fn decode_value(ptr: i32, len: i32): () -> Result<MsgPack, MsgPackError>
Decodes one MessagePack value from the readable memory region [ptr, ptr + len).
Returns Err(MsgPackError) when decoding fails or when trailing bytes remain
after the first value.
fn missing_field<T>(field: String): () -> Result<T, MsgPackError>
Type Aliases
type MsgPack = RawMsgPack
mod std::msgpack::errors
Public MessagePack boundary error definitions.
Objects
obj MsgPackError
mod std::msgpack::fns
MessagePack serializer implementation used by std::msgpack.
This module owns the in-memory codec and value constructors/unpackers.
Objects
obj MsgPackMap
Internal representation for MessagePack maps before conversion to Dict.
obj MsgPackWriter
Direct MessagePack sink used by compiler-generated DTO traversal.
impl MsgPackWriter
impl MsgPackWriter for DataWriter<MsgPackError>
obj MsgPackReader
Direct MessagePack source used by compiler-generated DTO traversal.
impl MsgPackReader
impl MsgPackReader for DataReader<MsgPackError>
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 I32
MessagePack 32-bit integer wrapper.
obj I64
MessagePack 64-bit integer wrapper.
obj F32
MessagePack 32-bit float wrapper.
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::number
Numeric conversion APIs.
Use std::number::cast for explicit primitive conversions and checked
narrowing operations, plus primitive numeric string formatting.
Re-Exports
pub cast
pub cast::all
mod std::number::cast
Primitive numeric conversion APIs.
This module centralizes numeric conversion intrinsics behind explicit,
typed std functions.
Functions
fn number_format_error_code_invalid_precision() -> i32
The requested precision is outside the supported range.
fn number_format_error_code_non_finite() -> i32
The policy rejects the provided NaN or infinite value.
fn cast_error_code_invalid_input() -> i32
Error code for non-finite or non-integer checked float inputs.
fn cast_error_code_overflow() -> i32
Error code for values that overflow the destination type.
fn cast_error<T>(code: i32) -> Result<T, CastError>
Constructs a CastError result with the provided code.
fn to_f64(value: i32) -> f64
Converts an i32 to f64.
fn to_f64(value: i64) -> f64
Converts an i64 to f64.
fn to_f64(value: f32) -> f64
Converts an f32 to f64.
fn to_f32(value: i32) -> f32
Converts an i32 to f32.
fn to_f32(value: i64) -> f32
Converts an i64 to f32.
fn to_f32(value: f64) -> f32
Converts an f64 to f32.
fn to_i64(value: i32) -> i64
Sign-extends an i32 into i64.
fn to_i32_wrapping(value: i64) -> i32
Wraps an i64 into i32 by truncating to the low 32 bits.
fn to_i32_checked(value: i64): () -> Result<i32, CastError>
Converts an i64 to i32, returning overflow on narrowing failure.
fn to_i32_checked(value: f32): () -> Result<i32, CastError>
Converts an f32 to i32, requiring a finite in-range value.
Fractional values are truncated toward zero.
fn to_i32_checked(value: f64): () -> Result<i32, CastError>
Converts an f64 to i32, requiring a finite in-range value.
Fractional values are truncated toward zero.
fn to_i64_checked(value: f32): () -> Result<i64, CastError>
Converts an f32 to i64, requiring a finite in-range value.
Fractional values are truncated toward zero.
fn to_i64_checked(value: f64): () -> Result<i64, CastError>
Converts an f64 to i64, requiring a finite in-range value.
Fractional values are truncated toward zero.
fn reinterpret_i32(value: f32) -> i32
Reinterprets f32 bits as i32.
fn reinterpret_f32(value: i32) -> f32
Reinterprets i32 bits as f32.
fn reinterpret_i64(value: f64) -> i64
Reinterprets f64 bits as i64.
fn reinterpret_f64(value: i64) -> f64
Reinterprets i64 bits as f64.
fn to_string(value: i32) -> String
Formats an i32 as decimal text.
fn to_string(value: i64) -> String
Formats an i64 as decimal text.
fn to_string(value: f32) -> String
Formats an f32 as decimal text.
fn to_string(value: f64) -> String
Formats an f64 as decimal text.
Non-finite values format as NaN, Infinity, or -Infinity.
fn format_fixed(
value: f64,
{
decimal_places: i32
trim_trailing_zeros?: bool
non_finite?: NonFinitePolicy
}
): () -> Result<String, NumberFormatError>
Formats an f64 with a fixed number of decimal places.
Rounding uses IEEE-754 ties-to-even semantics. Negative zero is normalized
to unsigned zero. decimal_places must be between 0 and 15.
fn format_fixed(
value: f32,
{
decimal_places: i32
trim_trailing_zeros?: bool
non_finite?: NonFinitePolicy
}
): () -> Result<String, NumberFormatError>
Formats an f32 with a fixed number of decimal places.
fn format_significant(
value: f64,
{
digits: i32
trim_trailing_zeros?: bool
non_finite?: NonFinitePolicy
}
): () -> Result<String, NumberFormatError>
Formats an f64 with the requested significant decimal digits.
Values with decimal exponents outside -6...20 use compact scientific
notation. digits must be between 1 and 16.
fn format_significant(
value: f32,
{
digits: i32
trim_trailing_zeros?: bool
non_finite?: NonFinitePolicy
}
): () -> Result<String, NumberFormatError>
Formats an f32 with the requested significant decimal digits.
fn format_scientific(
value: f64,
{
digits: i32
trim_trailing_zeros?: bool
non_finite?: NonFinitePolicy
}
): () -> Result<String, NumberFormatError>
Formats an f64 in compact scientific notation such as 1.25e6.
digits counts all significant digits and must be between 1 and 16.
fn format_scientific(
value: f32,
{
digits: i32
trim_trailing_zeros?: bool
non_finite?: NonFinitePolicy
}
): () -> Result<String, NumberFormatError>
Formats an f32 in compact scientific notation.
Objects
obj CastError
Error returned by checked numeric casts.
obj NonFinitePolicy
Controls how explicit number-formatting APIs handle NaN and infinities.
impl NonFinitePolicy
obj NumberFormatError
Error returned by explicit number-formatting APIs.
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 is the public surface for stdout/stderr writes, flushing, and
terminal detection. Single-argument helpers default to stdout; pass
StdErr {} when you need to target stderr explicitly.
Functions
fn write(value: StringSlice): Output -> Result<Unit, IoError>
Shorthand for write(value, StdOut {}).
fn write(value: String): Output -> Result<Unit, IoError>
Shorthand for write(value.as_slice()).
fn write(value: StringSlice, target: OutputTarget): Output -> Result<Unit, IoError>
Writes UTF-8 text to target.
Use this overload as the canonical text-write entry point when you need to
choose stdout vs stderr explicitly.
fn write(value: String, target: OutputTarget): Output -> Result<Unit, IoError>
Shorthand for write(value.as_slice(), target).
fn write_line(value: StringSlice): Output -> Result<Unit, IoError>
Shorthand for write_line(value, StdOut {}).
fn write_line(value: String): Output -> Result<Unit, IoError>
Shorthand for write_line(value.as_slice()).
fn write_line(value: StringSlice, target: OutputTarget): Output -> Result<Unit, IoError>
Writes value followed by exactly one line-feed byte to target.
This is the canonical line-oriented write API for this module. It always
appends \n and does not inspect whether value already ends with one.
fn write_line(value: String, target: OutputTarget): Output -> Result<Unit, IoError>
Shorthand for write_line(value.as_slice(), target).
fn print(value: StringSlice): Output -> void
Writes one whole line to stdout.
print is a best-effort convenience helper for debugging and scripting. It
intentionally ignores write failures instead of surfacing IoError. Use
write_line when you need to observe or handle output errors.
fn print(value: String): Output -> void
Shorthand for print(value.as_slice()).
fn print(value: i32): Output -> void
Shorthand for print(to_string(value)).
fn print(value: i64): Output -> void
Shorthand for print(to_string(value)).
fn print(value: f32): Output -> void
Shorthand for print(to_string(value)).
fn print(value: f64): Output -> void
Shorthand for print(to_string(value)).
fn write(bytes: Bytes): Output -> Result<Unit, IoError>
Shorthand for write(bytes, StdOut {}).
fn write(bytes: Bytes, target: OutputTarget): Output -> Result<Unit, IoError>
Writes raw bytes to target without UTF-8 encoding.
Use this for binary output or when text conversion would be incorrect.
fn flush(): Output -> Result<Unit, IoError>
Shorthand for flush(StdOut {}).
fn flush(target: OutputTarget): Output -> Result<Unit, IoError>
Flushes buffered output for target.
fn is_tty(): Output -> bool
Shorthand for is_tty(StdOut {}).
fn is_tty(target: OutputTarget): Output -> bool
Returns whether target is attached to an interactive terminal.
Type Aliases
type OutputTarget = |(StdOut, StdErr)
Objects
obj StdOut
obj StdErr
obj OutputWriteRequest
obj OutputWriteBytesRequest
obj OutputTargetRequest
obj OutputResult
Effects
eff Output
Host output effect used by std::output.
Operations in this effect forward automatic DTO values to host-managed
stdout and stderr streams.
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.
Package-root exports intentionally mirror the safe default surface area.
Advanced/raw constructors stay available from their owning modules so callers
opt in explicitly, for example std::array::new_array_unchecked or
std::string::new_string.
Re-Exports
pub array
pub optional
pub result
pub async
pub prelude
pub error
pub version
pub enums
pub string
pub box
pub memory
pub shared_cell
pub msgpack
pub dict
pub range
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 http
pub input
pub output
pub path
pub fs
pub test
pub task
pub meta
pub data
pub std::output::print
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::dict::Dict
pub std::dict::DictEntry
pub std::dict::DictKey
pub std::traits::Sequence
pub std::traits::Iterator
pub std::traits::for
pub std::range::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::from_utf8
pub std::box::Box
pub std::shared_cell::SharedCell
pub std::shared_cell::SharedCellBorrowError
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
pub number
Macros
macro ??
macro ?.
macro enum
macro for
mod std::prelude
Safe default imports for source modules.
std::prelude is implicitly imported for src modules and should stay
limited to everyday, high-confidence APIs. Advanced constructors that depend
on raw storage invariants, such as std::array::new_array_unchecked and
std::string::new_string, require explicit module-qualified imports.
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::optional::fns::??
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::result::fns::and_then
pub std::result::fns::unwrap_or
pub std::enums::enum
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::traits::for
pub std::range::Range
pub std::array::Array
pub std::array::ArrayPop
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::log
pub std::output
pub std::output::print
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::from_utf8
pub std::error::panic
pub std::test::assertions::assert
Macros
macro ??
macro enum
macro for
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 random_error_code_invalid_length() -> i32
The requested secure-byte length is negative.
fn random_error_code_invalid_payload() -> i32
The host returned a malformed, truncated, or out-of-range byte payload.
fn next_i64(): Random -> i64
Returns a random 64-bit integer.
fn next_u64(): Random -> U64Bits
Returns random 64-bit bits interpreted as an unsigned integer payload.
fn secure_bytes(len: i32): Random -> Result<Bytes, RandomError>
Returns exactly len cryptographically secure random bytes.
The host payload is validated without normalization or pseudo-random
fallback. A deterministic Random::fill_bytes handler can supply fixtures
in tests.
fn fill_bytes(buf: ByteBuffer, len: i32): Random -> ByteBuffer
Fills a byte buffer with cryptographically secure random bytes.
len controls the number of bytes appended to buf.
Example:
let buf = random::fill_bytes(ByteBuffer::init(), len: 16)
buf.len() == 16
fn random_bool(): Random -> bool
Returns a random boolean value.
fn random_i32(): Random -> i32
Returns a random i32 value.
Default behavior (no range): samples across the full i32 domain.
fn random_i32(range: Range<i32>): Random -> i32
Returns a random i32 value 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_i32(1..6) samples values in [1, 5].
fn random_i64(): Random -> i64
Returns a random i64 value.
Default behavior (no range): samples across the full i64 domain.
fn random_i64(range: Range<i64>): Random -> i64
Returns a random i64 value within the provided range.
The range lower bound is inclusive. The upper bound follows Range:
exclusive by default, inclusive when include_end is true.
fn random_f64(): Random -> f64
Returns a random floating-point value in [0.0, 1.0).
This no-argument overload is the default behavior.
fn random_f64(range: Range<f64>): Random -> f64
Returns a random floating-point value within the provided range.
The lower bound is inclusive. The upper bound follows Range semantics:
exclusive by default, inclusive when include_end is true.
Example:
random::random_f64(0.0..10.0) samples values in [0.0, 10.0).
fn random_f32(): Random -> f32
Returns a random floating-point value in [0.0, 1.0) as f32.
This no-argument overload is the default behavior.
fn random_f32(range: Range<f32>): Random -> f32
Returns a random floating-point value within the provided range as f32.
The lower bound is inclusive. The upper bound follows Range semantics:
exclusive by default, inclusive when include_end is true.
Objects
obj RandomError
Error returned when secure host entropy cannot satisfy a byte request.
obj UuidParseError
Error returned when UUID text is not in canonical hyphenated form.
obj Uuid
A 128-bit universally unique identifier.
Uuid::v4 uses the host Random effect's cryptographically secure byte
source. Text formatting is canonical lower-case 8-4-4-4-12 hexadecimal.
impl Uuid
obj U64Bits
Raw 64-bit bits interpreted as unsigned payload.
val LocalRng
Fast deterministic pseudo-random generator for local sampling.
LocalRng is not cryptographically secure. It is intended for hot local
loops (for example, render jitter) where host-effect round-trips are too
expensive.
impl LocalRng
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::range
Integer range type and iteration behavior.
Range is used by slicing and range-based APIs across std.
Objects
obj Range<T>
Range value used by slicing and bounded APIs.
impl Range<i32> for Sequence<i32>
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().inserting("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. Prefer from_utf8 for external bytes and reserve
new_string for advanced code that already owns trusted UTF-8 storage.
Re-Exports
pub index::StringIndex
pub type::CharSet
pub type::ParseFloatError
pub type::ParseIntError
pub type::String
pub type::StringSlice
pub type::Utf8Error
Functions
fn new_string(from_bytes: FixedArray<i32>): () -> String
Builds a string from owned UTF-8 byte storage without re-validating it.
This is the sharp-edge constructor for code that already controls the
underlying bytes. Invalid sequences are normalized into replacement runes
during decoding, so prefer from_utf8 when bytes come from external input.
fn from_utf8(source: Array<i32>) -> Result<String, Utf8Error>
Validates UTF-8 bytes and builds a string on success.
This is the canonical public entry point for converting byte arrays into
strings from untrusted or host-provided data.
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 stable byte window
backed by retained immutable storage. 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 Eq<String>
impl String for Sequence<i32>
obj StringSlice
Stable view into an immutable UTF-8 byte range.
The backing storage is retained directly, so later mutation of the source
String does not invalidate this value or change its contents.
impl StringSlice
impl StringSlice for Eq<StringSlice>
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::subscript
Subscript traits.
Provides shared indexing contracts for read and write operations.
Traits
trait SubscriptRead<Index, Output>
Read-only subscript contract.
trait SubscriptWrite<Index, Value>
Mutable subscript contract.
mod std::task
Same-run task primitives backed by the runtime task scheduler.
Tasks are concurrent units of work inside a single Voyd run. They are
cooperative and event-loop driven, not thread-parallel.
Functions
fn spawn<T>(work: fn: (open) -> T): (TaskRuntime, open) -> Task<T>
fn detach<T>(work: fn: (open) -> T): (TaskRuntime, open) -> Task<T>
fn join(task: Task<void>): TaskRuntime -> TaskOutcome<Unit>
fn join<T>(task: Task<T>): TaskRuntime -> TaskOutcome<T>
fn cancel<T>(task: Task<T>): TaskRuntime -> bool
fn yield_now(): TaskRuntime -> Unit
Type Aliases
type TaskOutcome<T> = Completion<T, TaskError>
Objects
obj Task<T>
impl Task<void>
impl<T> Task<T>
obj TaskError
Effects
eff TaskRuntime
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 backed by the host Time effect.
Includes monotonic timing (Instant), wall-clock timing (SystemTime),
duration utilities, and blocking sleep.
Functions
fn timestamp_error_code_invalid_format() -> i32
The timestamp does not match the supported RFC 3339 grammar.
fn timestamp_error_code_invalid_date() -> i32
The timestamp contains an invalid Gregorian calendar date.
fn timestamp_error_code_invalid_time() -> i32
The timestamp contains an invalid wall-clock time.
fn timestamp_error_code_invalid_offset() -> i32
The timestamp contains an invalid UTC offset.
fn timestamp_error_code_out_of_range() -> i32
The timestamp is outside RFC 3339's four-digit year range.
fn timestamp_error_code_unsupported_precision() -> i32
The timestamp contains more precision than SystemTime can preserve.
fn timestamp_error_code_overflow() -> i32
Timestamp arithmetic exceeded the representable range.
fn timestamp_error_code_formatting() -> i32
SystemTime could not be represented in the requested timestamp format.
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 set_timeout<T>(
delay: Duration,
work: (fn) -> T
): ::(task, TaskRuntime) -> ::(task, Task<T>)
Schedules a detached callback task to run after the provided delay.
fn after_delay<T>(
delay: Duration,
work: (fn) -> T
): (::(task, TaskRuntime), Time) -> T
Runs callback work after waiting for the provided delay.
fn set_interval<T>(
delay: Duration,
overlap: Overlap,
work: (fn) -> T
): ::(task, TaskRuntime) -> ::(task, Task<Unit>)
Schedules repeating callback work using the provided overlap policy.
The returned task is the interval driver. Cancelling it prevents future ticks.
Objects
obj TimestampError
Error returned when an RFC 3339 timestamp cannot be parsed or formatted.
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
obj Overlap
Interval overlap policy.
Policies are explicit so repeating work does not silently adopt JS-style
concurrent overlap.
impl Overlap
obj TimeResult
Effects
eff Time
Host-provided time operations.
std::time 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
Re-Exports
pub canvas
pub command::Cmd
pub command::Ref
Functions
fn keyboard_on_key_down<Msg>(
{
key: String
value: Msg
}
) -> Sub<Msg>
Subscribes to global keydown events through the browser VX runtime host.
fn keyboard_on_key_down<Msg>(
{
key: String
handler: (fn(KeyboardEvent)) -> Msg
}
) -> Sub<Msg>
fn keyboard_on_key_down<Msg>(
{
key: StringSlice
value: Msg
}
) -> Sub<Msg>
fn keyboard_on_key_down<Msg>(
{
key: StringSlice
handler: (fn(KeyboardEvent)) -> Msg
}
) -> Sub<Msg>
fn keyboard_on_key_up<Msg>(
{
key: String
value: Msg
}
) -> Sub<Msg>
Subscribes to global keyup events through the browser VX runtime host.
fn keyboard_on_key_up<Msg>(
{
key: String
handler: (fn(KeyboardEvent)) -> Msg
}
) -> Sub<Msg>
fn keyboard_on_key_up<Msg>(
{
key: StringSlice
value: Msg
}
) -> Sub<Msg>
fn keyboard_on_key_up<Msg>(
{
key: StringSlice
handler: (fn(KeyboardEvent)) -> Msg
}
) -> Sub<Msg>
fn online_status<Msg>(
{
key: String
value: Msg
}
) -> Sub<Msg>
Subscribes to browser online/offline changes through the VX runtime host.
fn online_status<Msg>(
{
key: String
handler: (fn(bool)) -> Msg
}
) -> Sub<Msg>
fn online_status<Msg>(
{
key: StringSlice
value: Msg
}
) -> Sub<Msg>
fn online_status<Msg>(
{
key: StringSlice
handler: (fn(bool)) -> Msg
}
) -> Sub<Msg>
fn window_on_resize<Msg>(
{
key: String
value: Msg
}
) -> Sub<Msg>
Subscribes to browser window resize changes through the VX runtime host.
fn window_on_resize<Msg>(
{
key: String
handler: (fn(WindowSize)) -> Msg
}
) -> Sub<Msg>
fn window_on_resize<Msg>(
{
key: StringSlice
value: Msg
}
) -> Sub<Msg>
fn window_on_resize<Msg>(
{
key: StringSlice
handler: (fn(WindowSize)) -> Msg
}
) -> Sub<Msg>
fn document_on_visibility_change<Msg>(
{
key: String
value: Msg
}
) -> Sub<Msg>
Subscribes to document visibility changes through the VX runtime host.
fn document_on_visibility_change<Msg>(
{
key: String
handler: (fn(DocumentVisibility)) -> Msg
}
) -> Sub<Msg>
fn document_on_visibility_change<Msg>(
{
key: StringSlice
value: Msg
}
) -> Sub<Msg>
fn document_on_visibility_change<Msg>(
{
key: StringSlice
handler: (fn(DocumentVisibility)) -> Msg
}
) -> Sub<Msg>
fn location_on_change<Msg>(
{
key: String
value: Msg
}
) -> Sub<Msg>
Subscribes to browser URL changes from history traversal or hash changes.
fn location_on_change<Msg>(
{
key: String
handler: (fn(Location)) -> Msg
}
) -> Sub<Msg>
fn location_on_change<Msg>(
{
key: StringSlice
value: Msg
}
) -> Sub<Msg>
fn location_on_change<Msg>(
{
key: StringSlice
handler: (fn(Location)) -> Msg
}
) -> Sub<Msg>
fn window_on_focus<Msg>(
{
key: String
value: Msg
}
) -> Sub<Msg>
Subscribes to browser window focus events.
fn window_on_focus<Msg>(
{
key: String
handler: (fn(GenericEvent)) -> Msg
}
) -> Sub<Msg>
fn window_on_focus<Msg>(
{
key: StringSlice
value: Msg
}
) -> Sub<Msg>
fn window_on_focus<Msg>(
{
key: StringSlice
handler: (fn(GenericEvent)) -> Msg
}
) -> Sub<Msg>
fn window_on_blur<Msg>(
{
key: String
value: Msg
}
) -> Sub<Msg>
Subscribes to browser window blur events.
fn window_on_blur<Msg>(
{
key: String
handler: (fn(GenericEvent)) -> Msg
}
) -> Sub<Msg>
fn window_on_blur<Msg>(
{
key: StringSlice
value: Msg
}
) -> Sub<Msg>
fn window_on_blur<Msg>(
{
key: StringSlice
handler: (fn(GenericEvent)) -> Msg
}
) -> Sub<Msg>
fn animation_frame<Msg>(
{
key: String
value: Msg
}
) -> Sub<Msg>
Subscribes to browser animation frames.
fn animation_frame<Msg>(
{
key: String
handler: (fn(AnimationFrame)) -> Msg
}
) -> Sub<Msg>
fn animation_frame<Msg>(
{
key: StringSlice
value: Msg
}
) -> Sub<Msg>
fn animation_frame<Msg>(
{
key: StringSlice
handler: (fn(AnimationFrame)) -> Msg
}
) -> Sub<Msg>
fn media_query<Msg>(
{
query: String
value: Msg
}
) -> Sub<Msg>
Subscribes to a browser media query.
fn media_query<Msg>(
{
query: String
handler: (fn(MediaQuery)) -> Msg
}
) -> Sub<Msg>
fn media_query<Msg>(
{
query: StringSlice
value: Msg
}
) -> Sub<Msg>
fn media_query<Msg>(
{
query: StringSlice
handler: (fn(MediaQuery)) -> Msg
}
) -> Sub<Msg>
fn storage_on_change<Msg>(
{
key: String
value: Msg
}
) -> Sub<Msg>
Subscribes to browser storage events.
fn storage_on_change<Msg>(
{
key: String
handler: (fn(StorageChange)) -> Msg
}
) -> Sub<Msg>
fn storage_on_change<Msg>(
{
key: StringSlice
value: Msg
}
) -> Sub<Msg>
fn storage_on_change<Msg>(
{
key: StringSlice
handler: (fn(StorageChange)) -> Msg
}
) -> Sub<Msg>
fn broadcast_channel<Msg>(
{
name: String
value: Msg
}
) -> Sub<Msg>
Subscribes to messages from a browser BroadcastChannel.
fn broadcast_channel<Payload, Msg>(
{
name: String
handler: (fn(Payload)) -> Msg
}
) -> Sub<Msg>
fn broadcast_channel<Msg>(
{
name: StringSlice
value: Msg
}
) -> Sub<Msg>
fn broadcast_channel<Payload, Msg>(
{
name: StringSlice
handler: (fn(Payload)) -> Msg
}
) -> Sub<Msg>
fn state_handle<T>({ initial: T }): Component -> StateHandle<T>
Reads a component-local typed state handle.
fn state_handle({ initial: StringSlice }): Component -> StateHandle<String>
fn state<T>({ initial: T }): Component -> (T, (fn(T)) -> void)
Reads component-local typed state as a (value, setter) pair.
fn state({ initial: StringSlice }): Component -> (String, (fn(String)) -> void)
fn task<Key, T>(
{
key: Key
task: Task<T>
}
): Component -> Unit
Registers a task with the current component instance.
fn lower_server_html_node<Msg>(value: Html<Msg>): () -> HtmlWire
Lowers a view for server rendering, claims its callbacks, and removes
client-only message mapping nodes.
fn frame<Msg>(root: Html<Msg>): () -> Html<Msg>
Creates a versioned VX render frame.
fn text(value: String): () -> Html<void>
Creates a VX text node.
fn text(value: StringSlice): () -> Html<void>
Creates a VX text node from a string slice.
fn html_child(value: Html<void>): () -> Html<void>
Converts a nested node into the opaque child plan expected by VSX lowering.
fn html_child<Msg>(value: Html<Msg>): () -> Html<Msg>
fn html_child<Msg>(value: HtmlInput<Msg>): () -> Html<Msg>
fn html_child(value: String): () -> Html<void>
Converts interpolated text into an opaque child plan.
fn html_child(value: StringSlice): () -> Html<void>
fn html_child(value: Array<Html<void>>): () -> Html<void>
Flattens an interpolated child list into one fragment plan.
fn html_child<Msg>(value: Array<HtmlInput<Msg>>): () -> Html<Msg>
fn html_child<Msg>(value: Array<Html<Msg>>): () -> Html<Msg>
fn fragment(children: Array<Html<void>>): () -> Html<void>
Creates a VX fragment node.
fn fragment<Msg>(children: Array<HtmlInput<Msg>>): () -> Html<Msg>
fn element(
{
tag: String
attrs?: Array<Attr<void>>
children: Array<Html<void>>
}
) -> Html<void>
Creates a VX element node using the versioned renderer schema.
fn element<Msg>(
{
tag: String
attrs?: Array<Attr<Msg>>
children: Array<Html<Msg>>
}
) -> Html<Msg>
fn element<Msg>(
{
tag: String
attrs: Array<AttrInput<Msg>>
children: Array<HtmlInput<Msg>>
}
) -> Html<Msg>
fn html_element(
{
tag: String
attrs?: Array<Attr<void>>
children: Array<Html<void>>
}
) -> Html<void>
fn html_element<Msg>(
{
tag: String
attrs?: Array<Attr<Msg>>
children: Array<Html<Msg>>
}
) -> Html<Msg>
fn html_element<Msg>(
{
tag: String
attrs: Array<AttrInput<Msg>>
children: Array<HtmlInput<Msg>>
}
) -> Html<Msg>
fn attr(
{
name: String
value: String
}
): () -> Attr<void>
Creates a string-valued DOM attribute.
fn attr(
{
name: String
value: bool
}
): () -> Attr<void>
fn attr(
{
name: String
value: i32
}
): () -> Attr<void>
fn attr(
{
name: StringSlice
value: String
}
): () -> Attr<void>
fn attr(
{
name: StringSlice
value: bool
}
): () -> Attr<void>
fn attr(
{
name: StringSlice
value: i32
}
): () -> Attr<void>
fn attr(
{
name: String
value: StringSlice
}
): () -> Attr<void>
fn attr(
{
name: StringSlice
value: StringSlice
}
): () -> Attr<void>
fn id(value: String): () -> Attr<void>
fn id(value: StringSlice): () -> Attr<void>
fn class(value: String): () -> Attr<void>
fn class(value: StringSlice): () -> Attr<void>
fn classes(values: Array<String>): () -> Attr<void>
fn role(value: String): () -> Attr<void>
fn role(value: StringSlice): () -> Attr<void>
fn name(value: String): () -> Attr<void>
fn name(value: StringSlice): () -> Attr<void>
fn placeholder(value: String): () -> Attr<void>
fn placeholder(value: StringSlice): () -> Attr<void>
fn input_type(value: String): () -> Attr<void>
fn input_type(value: StringSlice): () -> Attr<void>
fn tab_index(value: i32): () -> Attr<void>
fn ref<T>(target: Ref<T>): () -> Attr<void>
fn value(value: String): () -> Attr<void>
fn value(value: StringSlice): () -> Attr<void>
fn disabled(value: bool): () -> Attr<void>
fn checked(value: bool): () -> Attr<void>
fn prop(
{
name: String
value: String
}
): () -> Attr<void>
fn prop(
{
name: StringSlice
value: StringSlice
}
): () -> Attr<void>
fn prop(
{
name: String
value: bool
}
): () -> Attr<void>
fn prop(
{
name: StringSlice
value: bool
}
): () -> Attr<void>
fn prop(
{
name: String
value: i32
}
): () -> Attr<void>
fn prop(
{
name: StringSlice
value: i32
}
): () -> Attr<void>
fn style(
{
name: String
value: String
}
): () -> Attr<void>
fn style(
{
name: StringSlice
value: StringSlice
}
): () -> Attr<void>
fn styles(values: Array<(String, String)>): () -> Array<Attr<void>>
fn keyed(
{
key: String
child: Html<void>
}
): () -> Html<void>
fn keyed(
{
key: StringSlice
child: Html<void>
}
): () -> Html<void>
fn keyed<Msg>(
{
key: String
child: Html<Msg>
}
): () -> Html<Msg>
fn keyed<Msg>(
{
key: StringSlice
child: Html<Msg>
}
): () -> Html<Msg>
fn keyed(
{
key: String
body: (fn) -> Html<void>
}
): Component -> Html<void>
fn keyed(
{
key: StringSlice
body: (fn) -> Html<void>
}
): Component -> Html<void>
fn map_html<ChildMsg, ParentMsg>(
{
html: Html<ChildMsg>
handler: (fn(ChildMsg)) -> ParentMsg
}
) -> Html<ParentMsg>
Lifts child HTML through a message mapper owned by the current render.
fn map_html<ChildMsg, ParentMsg>(
{
html: Html<void>
handler: (fn(ChildMsg)) -> ParentMsg
}
) -> Html<ParentMsg>
fn event_handler<Msg>(
{
name: String
handler: (fn) -> Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn event_handler<Msg>(
{
name: StringSlice
handler: (fn) -> Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn event_payload_handler<Event, Msg>(
{
name: String
handler: (fn(Event)) -> Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn event_payload_handler<Event, Msg>(
{
name: StringSlice
handler: (fn(Event)) -> Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn event_message<Msg>(
{
name: String
message: (fn) -> Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn event_message<Msg>(
{
name: StringSlice
message: (fn) -> Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn event_message<Event, Msg>(
{
name: String
message: (fn(Event)) -> Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn event_message<Event, Msg>(
{
name: StringSlice
message: (fn(Event)) -> Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn event_message<Msg>(
{
name: String
message: Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn event_message<Msg>(
{
name: StringSlice
message: Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn html_event_message<Msg>(
{
name: String
message: (fn) -> Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn html_event_message<Event, Msg>(
{
name: String
message: (fn(Event)) -> Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn html_event_message<Msg>(
{
name: String
message: Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn html_event_handler<Msg>(
{
name: String
handler: (fn) -> Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn html_event_payload_handler<Event, Msg>(
{
name: String
handler: (fn(Event)) -> Msg
options?: EventOptions
}
): () -> Attr<Msg>
fn on_click_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_click_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_double_click_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_double_click_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_mouse_down_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_mouse_down_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_mouse_up_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_mouse_up_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_mouse_move_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_mouse_move_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_mouse_enter_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_mouse_enter_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_mouse_leave_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_mouse_leave_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_pointer_down_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_pointer_down_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_pointer_up_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_pointer_up_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_pointer_move_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_pointer_move_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_pointer_cancel_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_pointer_cancel_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_key_down_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_key_down_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_key_up_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_key_up_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_input_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_input_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_change_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_change_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_submit_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_submit_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_focus_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_focus_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_blur_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_blur_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_scroll_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_scroll_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_wheel_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_wheel_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_drag_start_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_drag_start_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_drag_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_drag_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_drag_end_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_drag_end_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_drop_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_drop_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn on_context_menu_message<Msg>(message: Msg): () -> Attr<Msg>
fn on_context_menu_with<Msg>(
{
options: EventOptions
message: Msg
}
): () -> Attr<Msg>
fn program<Model, Msg>(
{
model: Model
frame?: Html<Msg>
commands?: Cmd<Msg>
subscriptions?: Sub<Msg>
}
) -> Program<Model, Msg>
fn next<Model, Msg>(model: Model) -> Program<Model, Msg>
Creates the next program transition from an explicit model.
fn next<Model, Msg>(
{
model: Model
cmd: Cmd<Msg>
}
) -> Program<Model, Msg>
Creates the next program transition with one command.
fn map_model<Model, Msg, NextModel>(
program: Program<Model, Msg>,
handler: (fn(Model)) -> NextModel
) -> Program<NextModel, Msg>
Lifts a child program result through a typed model mapper.
fn map_model<Model, Msg, NextModel>(
{
program: Program<Model, Msg>
map: (fn(Model)) -> NextModel
hydrate: (fn(NextModel)) -> Model
}
) -> Program<NextModel, Msg>
Lifts a child program through model mappers in both runtime directions.
The hydrate mapper is required when the mapped program adopts an SSR model.
fn map_message<Model, ChildMsg, ParentMsg>(
program: Program<Model, ChildMsg>,
handler: (fn(ChildMsg)) -> ParentMsg
) -> Program<Model, ParentMsg>
Lifts a child program result through a typed message mapper.
fn program<Model, Msg>(
{
init: fn: (open) -> Model
hydrate?: fn(Model): (open) -> Program<Model, Msg>
step: fn(Model, Msg): (open) -> Program<Model, Msg>
view: fn(Model): (open) -> Html<Msg>
subscriptions?: fn(Model): (open) -> Sub<Msg>
}
) -> Program<Model, Msg>
fn program<Model, Msg>(
{
init: fn: (open) -> Program<Model, Msg>
hydrate?: fn(Model): (open) -> Program<Model, Msg>
step: fn(Model, Msg): (open) -> Program<Model, Msg>
view: fn(Model): (open) -> Html<Msg>
subscriptions?: fn(Model): (open) -> Sub<Msg>
}
) -> Program<Model, Msg>
Type Aliases
type AttrValueWire = |(|(AttrString, AttrBool), AttrI32)
type AttrWireNode = |(NamedAttr, EventAttr)
type HtmlWireList = |(HtmlWireEnd, HtmlWireNext)
type AttrWireList = |(AttrWireEnd, AttrWireNext)
type HtmlWireNode = |(|(|(|(|(HtmlText, HtmlFragment), HtmlElement), HtmlKeyed), HtmlMapped), HtmlFrame)
type SubscriptionWire = |(|(|(|(SubscriptionNone, SubscriptionBatch), SubscriptionRuntime), SubscriptionMap), SubscriptionOwned)
type ProgramWire = |(|(|(ProgramResult, ProgramMapModel), ProgramMapMessage), ProgramHandlers)
type HtmlInput<Msg> = |(Html<void>, Html<Msg>)
type AttrInput<Msg> = |(Attr<void>, Attr<Msg>)
type RenderKey = String
type MouseEvent = object_literal(kind: String, pointer_id: i32, x: f64, y: f64, client_x: f64, client_y: f64, button: i32, alt_key: bool, ctrl_key: bool, meta_key: bool, shift_key: bool, delta_x: f64, delta_y: f64)
type KeyboardEvent = object_literal(kind: String, key: String, code: String, alt_key: bool, ctrl_key: bool, meta_key: bool, shift_key: bool)
type WindowSize = object_literal(kind: String, width: f64, height: f64)
type DocumentVisibility = object_literal(kind: String, state: String, hidden: bool)
type Location = object_literal(kind: String, href: String, pathname: String, search: String, hash: String)
type AnimationFrame = object_literal(kind: String, timestamp: f64)
type MediaQuery = object_literal(kind: String, query: String, matches: bool)
type StorageChange = object_literal(kind: String, storage: String, ?:(key, String), ?:(old_value, String), ?:(new_value, String), url: String)
type InputEvent = object_literal(kind: String, value: String, checked: bool, input_type: String)
type SubmitEvent = object_literal(kind: String, form_keys: Array<String>, form_values: Array<String>)
type GenericEvent = object_literal(kind: String, event: String)
Objects
obj EventOptionsWire
obj AttrWire
obj HtmlWire
obj Html<Msg>
impl<Msg> Html<Msg> for CustomDto<Html<Msg>, HtmlWire>
obj Attr<Msg>
impl<Msg> Attr<Msg> for CustomDto<Attr<Msg>, AttrWire>
obj Program<Model, Msg>
impl<Model, Msg> Program<Model, Msg> for CustomDto<Program<Model, Msg>, ProgramWire>
obj Sub<Msg>
impl<Msg> Sub<Msg> for CustomDto<Sub<Msg>, SubscriptionWire>
impl<Msg> Sub<Msg>
impl<Msg> Sub<Msg>
obj EventOptions
obj DomElement
obj StateHandle<T>
impl<T> StateHandle<T>
Effects
eff Component
Implementations
impl<Msg> Cmd<Msg> for CustomDto<Cmd<Msg>, CommandWire>
mod std::vx::canvas
Typed Canvas rendering and measurement commands for VX.
Functions
fn render<Msg>(value: Frame) -> Cmd<Msg>
Paints a typed canvas frame through the browser VX runtime host.
fn measure_text<Msg>(
{
selector: String
value: String
font?: String
handler: (fn(TextMetrics)) -> Msg
}
) -> Cmd<Msg>
Measures text in logical CSS pixels and dispatches the typed metrics.
fn radial_gradient(
{
inner_color: String
outer_color: String
inner_radius?: f64
outer_radius?: f64
}
) -> RadialGradient
Creates a radial color fill for a canvas circle.
fn path_move_to(point: Point) -> PathSegment
Starts a path at a logical CSS-pixel point without drawing a segment.
fn path_line_to(point: Point) -> PathSegment
Adds a straight segment to a logical CSS-pixel point.
fn path_quadratic_curve_to(
{
control: Point
to: Point
}
) -> PathSegment
Adds a quadratic Bézier segment.
fn path_bezier_curve_to(
{
control_1: Point
control_2: Point
to: Point
}
) -> PathSegment
Adds a cubic Bézier segment.
fn path_arc(
{
center: Point
radius: f64
start_angle: f64
end_angle: f64
counter_clockwise?: bool
}
) -> PathSegment
Adds a circular arc. Angles are expressed in radians.
fn path_arc_to(
{
control_1: Point
control_2: Point
radius: f64
}
) -> PathSegment
Adds an arc tangent to two lines.
fn path_ellipse(
{
center: Point
radius_x: f64
radius_y: f64
rotation: f64
start_angle: f64
end_angle: f64
counter_clockwise?: bool
}
) -> PathSegment
Adds an elliptical arc. Angles and rotation are expressed in radians.
fn path_rect(
{
origin: Point
width: f64
height: f64
}
) -> PathSegment
Adds a rectangular subpath.
fn path_close() -> PathSegment
Closes the current path subpath.
fn path(
{
segments: Array<PathSegment>
fill?: String
stroke?: String
stroke_width?: f64
fill_rule?: FillRule
alpha?: f64
glow_color?: String
glow_blur?: f64
}
) -> Draw
Paints a typed path from its segments.
fn save() -> Draw
Saves the current transform, dash, compositing, and paint state.
fn restore() -> Draw
Restores the most recently saved Canvas state.
fn transform(matrix: Transform) -> Draw
Multiplies the current Canvas transform by an affine matrix.
fn translate(
{
x: f64
y: f64
}
) -> Draw
Translates subsequent draws in logical CSS pixels.
fn rotate(radians: f64) -> Draw
Rotates subsequent draws by radians.
fn scale(
{
x: f64
y: f64
}
) -> Draw
Scales subsequent draws along each axis.
fn line_dash(
{
pattern: Array<f64>
offset?: f64
}
) -> Draw
Sets the line-dash pattern for subsequent draws. An empty pattern resets it.
fn composite(operation: CompositeOperation) -> Draw
Sets the compositing operation for subsequent draws.
fn frame(
{
selector: String
width: f64
height: f64
draws: Array<Draw>
clear?: bool
background?: String
}
) -> Frame
Creates a versioned canvas frame in CSS-pixel logical coordinates.
fn line(
{
from: Point
to: Point
color: String
width?: f64
alpha?: f64
glow_color?: String
glow_blur?: f64
}
) -> Draw
Creates a straight canvas line.
fn polyline(
{
points: Array<Point>
color: String
width?: f64
alpha?: f64
closed?: bool
fill?: String
}
) -> Draw
Creates a connected canvas path, optionally closed and filled.
fn circle(
{
center: Point
radius: f64
fill?: String
stroke?: String
stroke_width?: f64
alpha?: f64
glow_color?: String
glow_blur?: f64
radial_gradient?: RadialGradient
}
) -> Draw
Creates a canvas circle with optional stroke, glow, and radial fill.
fn ellipse(
{
center: Point
radius_x: f64
radius_y: f64
rotation?: f64
fill?: String
stroke?: String
stroke_width?: f64
alpha?: f64
}
) -> Draw
Creates a canvas ellipse. Rotation is expressed in radians.
fn text(
{
position: Point
value: String
color: String
font?: String
align?: String
baseline?: String
alpha?: f64
max_width?: f64
}
) -> Draw
Creates canvas text using a CSS canvas font string.
Type Aliases
type FillRule = |(NonZero, EvenOdd)
type CompositeOperation = |(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(SourceOver, SourceIn), SourceOut), SourceAtop), DestinationOver), DestinationIn), DestinationOut), DestinationAtop), Lighter), Copy), Xor), Multiply), Screen), Overlay), Darken), Lighten), ColorDodge), ColorBurn), HardLight), SoftLight), Difference), Exclusion), Hue), Saturation), Color), Luminosity)
type TextMetrics = object_literal(width: f64, actual_bounding_box_left: f64, actual_bounding_box_right: f64, actual_bounding_box_ascent: f64, actual_bounding_box_descent: f64)
Logical CSS-pixel metrics returned by measure_text.
Objects
val Point
A logical point in CSS-pixel canvas coordinates.
val Transform
A 2D affine transform using the browser Canvas matrix convention.
obj PathSegment
A typed segment in a Canvas path.
impl PathSegment
impl PathSegment for CustomDto<PathSegment, PathSegmentDto>
obj Draw
A typed canvas draw or state operation produced by the Canvas constructors.
impl Draw
impl Draw for CustomDto<Draw, DrawDto>
obj Frame
A versioned canvas frame ready for the browser VX runtime.
impl Frame
impl Frame for CustomDto<Frame, FrameDto>
obj RadialGradient
A radial fill used by canvas circles.
impl RadialGradient
impl RadialGradient for CustomDto<RadialGradient, RadialGradientDto>
mod std::vx::command
Core VX command envelope and constructors shared by VX feature modules.