Skip to content

API Index

This page indexes every maintained public builtin constant, function, method, module type, and builtin enum documented by the manual. It is intentionally dense. Use the linked manual pages for examples and longer discussion.

assert condition and assert condition, message are statements rather than callable APIs. Their exact typing, lazy-message, AU4001, cleanup, and backend-parity contract is indexed separately in Assertions.

Top-Level Builtins

APISignatureContract
printprint(value) -> NoneRenders value and writes a newline.
rangerange(stop: int64) -> Range; range(start: int64, stop: int64) -> RangeEnd-exclusive integer range.
cancelledcancelled() -> boolReturns the current task cancellation state.
yield_nowyield_now() -> NoneVoluntarily yields the current lightweight task to the scheduler.
sleepsleep(duration: Duration) -> NoneSuspends the current task using the scheduler.
selectselect(source, ...) -> SelectOutcome[Q, T]Waits on one or more positional Queue, Task, or relative-Duration sources; cancellation wins, otherwise the lowest ready source index wins.
wait_anywait_any(tasks: list[Task[T]], timeout: Duration = ...) -> WaitAny[T]Waits for the first task outcome; consumes the list and abandons unchosen rights when T is non-repeatable. wait_any([]) returns TimedOut immediately.
wait_allwait_all(tasks: list[Task[T]], timeout: Duration = ...) -> WaitAll[T]Waits for all tasks, the first task error, timeout, or cancellation; consumes the list when T is non-repeatable.
absabs(value: number) -> numberAbsolute value for integers and floats.
minmin(left: number, right: number) -> numberSmaller value of the same numeric type.
maxmax(left: number, right: number) -> numberLarger value of the same numeric type.
sqrt`sqrt(value: float32float64) -> float32
roundround(value: T) -> T for integers; round(value: float32|float64) -> int64Integer identity or nearest-integer ties-to-even rounding.
divmoddivmod(left: T, right: T) -> (T, T) for one exact integer or float typePaired floor quotient and divisor-signed remainder.
parse_int32parse_int32(text: str) -> Result[int32, str]Parses a signed 32-bit integer.
parse_int64parse_int64(text: str) -> Result[int64, str]Parses a signed 64-bit integer.
parse_float64parse_float64(text: str) -> Result[float64, str]Parses a 64-bit float.
lenlen(value: str|list[T]|dict[K, V]|set[T]|Array[T]) -> int64Delegates to the value's own len() member with the same int64 type and value.
strstr(value) -> strRenders value exactly as print and f-string interpolation render it.

Foreign Declarations

FFI declarations are package-authorized direct calls, not builtins or first-class function values. Their names and exact signatures come from the binding package.

SurfaceSignatureContract
C functionextern "C" def name(...) -> RBodyless synchronous call to the same process-global symbol name.
Opaque handleextern "C" opaque class HandleNon-null, non-Copy, non-cloneable, non-Transfer foreign pointer wrapper.
str viewtext: strTemporary const UTF-8 pointer plus byte length; empty is (NULL, 0) and no NUL terminator is promised.
Byte viewbytes: list[uint8]Temporary const pointer plus byte length; empty is (NULL, 0).
Mutable byte viewbytes: mut list[uint8]Same-length scratch copy-in/out; writeback occurs after native return before result validation.
Consuming handlehandle: own HandleMoves the opaque handle into a foreign close/free-style call.

The complete scalar table, manifest report, safety boundary, diagnostics, and backend rules are in FFI v0.

Scalars And str

APISignatureContract
float64.sqrtsqrt() -> float64Square root of the receiver.
integer .to_floatto_float() -> float64Converts any integer type with IEEE-754 round-to-nearest, ties-to-even; may round.
integer wrapping methodswrapping_add(rhs), wrapping_sub(rhs), wrapping_mul(rhs)Same-type fixed-width two's-complement modular arithmetic.
integer saturating methodssaturating_add(rhs), saturating_sub(rhs), saturating_mul(rhs)Same-type arithmetic clamped to the declared width.
integer wrapping shiftswrapping_shl(count), wrapping_shr(count)Same-type count; left shift discards high bits and right shift matches >> after count validation.
integer saturating shiftssaturating_shl(count), saturating_shr(count)Same-type count; left shift clamps and right shift matches >> after count validation.
scalar .to_stringto_string() -> strSupported on bool, integer types, float32, and float64.
Duration.msDuration.ms(value: int64) -> DurationExact signed millisecond constructor.
Duration.secondsDuration.seconds(value: int64) -> DurationExact signed second constructor.
Duration.minutesDuration.minutes(value: int64) -> DurationExact signed minute constructor.
Duration.to_msto_ms() -> float64Converts exact nanoseconds to nearest-representable binary64 milliseconds, ties-to-even; may round; accepted under ADR-0019.
Duration.to_secondsto_seconds() -> float64Converts exact nanoseconds to nearest-representable binary64 seconds, ties-to-even; may round; accepted under ADR-0019.
str.lenlen() -> int64Counts Unicode scalar values in O(n).
str.byte_lenbyte_len() -> int64Returns the UTF-8 byte count in O(1).
str.to_bytesto_bytes() -> list[uint8]Returns a fresh list containing the receiver's exact UTF-8 bytes.
str.from_bytesfrom_bytes(bytes: list[uint8]) -> Result[str, bytes.Error]Strictly validates UTF-8 and returns a fresh str or the first invalid byte offset.
str.containscontains(text: str) -> booltrue when the receiver contains text.
str.starts_withstarts_with(text: str) -> boolPrefix test.
str.ends_withends_with(text: str) -> boolSuffix test.
str.splitsplit(text: str) -> list[str]Splits on each occurrence of text.
str.replacereplace(from: str, to: str) -> strReturns a new string with replacements applied.
str.to_lowerto_lower() -> strUnicode lowercase conversion.
str.to_upperto_upper() -> strUnicode uppercase conversion.
str.strip_prefixstrip_prefix(text: str) -> Option[str]Returns the remainder when the prefix matches.
str.strip_suffixstrip_suffix(text: str) -> Option[str]Returns the remainder when the suffix matches.
str.trimtrim() -> strRemoves surrounding Unicode whitespace.
str.joinjoin(parts: list[str]) -> strJoins parts using the receiver as separator.
str.cloneclone() -> strReturns a new owned string.

Duration operators are Duration + Duration, Duration - Duration, Duration * int64, int64 * Duration, and Duration // int64, all returning Duration, plus equality and all four ordering comparisons between Duration values. Arithmetic is checked on signed i128 nanoseconds.

Numeric Arrays

T and U below are each exactly one of int32, int64, float32, or float64. See Numeric Arrays for shape, ownership, diagnostic, and backend contracts.

APISignatureContract
Array[T].zeroszeros(shape: list[int64]) -> Array[T]Fresh rank-at-least-one row-major zero buffer.
Array[T].fullfull(shape: list[int64], value: T) -> Array[T]Fresh buffer filled with value.
Array[T].from_listfrom_list(values: list[T], shape: list[int64]) -> Array[T]Copies the shared list into exact row-major shape.
Array.shapeshape() -> list[int64]Owned shape snapshot.
Array.lenlen() -> int64Total element count.
Array.cloneclone() -> Array[T]Explicit fresh full-buffer copy.
Array.getget(index: list[int64]) -> Option[T]Optional coordinate read.
Array.setset(index: list[int64], value: T) -> Option[T]Mutable replacement; returns old scalar or traps on invalid coordinate/rank.
Array.fillfill(value: T) -> NoneMutable row-major fill.
Array.mapmap[U](f: def(T) -> U) -> Array[U]Eager row-major repeatable callback.
Array.sumsum() -> TDeterministic dtype reduction; empty returns zero.
Array.minmin() -> TMinimum; empty is AU4007.
Array.maxmax() -> TMaximum; empty is AU4007.
Array.meanmean() -> float64float64 accumulation/result; empty is AU4007.
integer Array wrapping methodswrapping_add(rhs), wrapping_sub(rhs), wrapping_mul(rhs)rhs is same-shape Array or same-dtype scalar; fresh Array result.
integer Array saturating methodssaturating_add(rhs), saturating_sub(rhs), saturating_mul(rhs)rhs is same-shape Array or same-dtype scalar; fresh Array result.

Math

See Math Module for the normative IEEE-754, domain, evaluation-order, diagnostic, and backend contracts. Every argument is exactly float64; the module performs no implicit numeric conversion.

APISignatureContract
math.pifloat64 constantNearest binary64 pi, bits 0x400921fb54442d18.
math.efloat64 constantNearest binary64 Euler's number, bits 0x4005bf0a8b145769.
math.inffloat64 constantPositive infinity, bits 0x7ff0000000000000.
math.nanfloat64 constantCanonical quiet NaN, bits 0x7ff8000000000000.
math.floorfloor(value: float64) -> int64Greatest integer less than or equal to value, checked for int64 range.
math.ceilceil(value: float64) -> int64Least integer greater than or equal to value, checked for int64 range.
math.trunctrunc(value: float64) -> int64Truncates toward zero, checked for int64 range.
math.powpow(base: float64, exponent: float64) -> float64Binary64 exponentiation with specified identity, domain, and overflow behavior.
math.expexp(value: float64) -> float64Base-e exponential.
math.loglog(value: float64) -> float64Natural logarithm.
math.log2log2(value: float64) -> float64Base-2 logarithm.
math.log10log10(value: float64) -> float64Base-10 logarithm.
math.sinsin(value: float64) -> float64Sine in radians.
math.coscos(value: float64) -> float64Cosine in radians.
math.tantan(value: float64) -> float64Tangent in radians.

Randomness

See Randomness Module for the normative xoshiro256** algorithm, seed-42 vectors, ownership, secure-source boundary, and diagnostics.

APISignatureContract
random.RngRng(seed: int64) -> random.RngCreates a move-only deterministic stream from the seed's exact two's-complement bit pattern.
random.Rng.next_intnext_int(lo: int64, hi: int64) -> int64Uniform half-open [lo, hi) integer; mutable receiver.
random.Rng.next_floatnext_float() -> float64Uniform 53-bit binary64 value in [0.0, 1.0); mutable receiver.
random.Rng.shuffleshuffle[T](values: mut list[T]) -> NoneDescending Fisher-Yates shuffle in place; mutable receiver and list.
random.secure_intsecure_int(lo: int64, hi: int64) -> int64OS-secure uniform half-open integer with no deterministic fallback.
random.secure_bytessecure_bytes(n: int64) -> list[uint8]Exactly n OS-secure bytes for 0 <= n <= 2147483647; zero skips entropy and larger counts trap with AU4005 before allocation.

random.Rng has no public clone route. AU3007 rejects the clone-producing collection and task APIs indexed below when their produced value contains, or may contain, an Rng, including through a user-defined wrapper. Cloning an allowed Task or Queue handle copies only the handle. Accepted ADR-0033 nevertheless rejects random.Rng as a task result or Queue payload with AU3008, and makes a Task with a non-repeatable result non-copyable. Moves, collection removals, and in-place shuffle within one owning task transfer or rearrange values without duplicating generator state. Generic clone-producing calls infer clone-safety obligations and discharge them after specialization; the obligation is retained through generic callers and module imports.

Bytes, Text Codecs, And SHA-256

See Bytes, Text Codecs, And SHA-256 for exact UTF-8 preservation, strict malformed-input policy, error offsets, ownership, output size preflights, and the cryptographic scope of SHA-256.

APISignatureContract
str.to_bytesto_bytes() -> list[uint8]Exact UTF-8 bytes; shared receiver and fresh result.
str.from_bytesfrom_bytes(bytes: list[uint8]) -> Result[str, bytes.Error]Strict UTF-8; no replacement decoding.
bytes.hex_encodehex_encode(value: list[uint8]) -> strTwo lowercase ASCII digits per byte.
bytes.hex_decodehex_decode(text: str) -> Result[list[uint8], bytes.Error]Accepts mixed-case ASCII hex; rejects prefixes, separators, and whitespace.
bytes.base64_encodebase64_encode(value: list[uint8]) -> strRFC 4648 standard alphabet with canonical padding.
bytes.base64_decodebase64_decode(text: str) -> Result[list[uint8], bytes.Error]Strict canonical standard-alphabet decode.
bytes.sha256sha256(value: list[uint8]) -> list[uint8]Fresh raw 32-byte FIPS 180-4 digest.
bytes.sha256_stringsha256_string(text: str) -> list[uint8]SHA-256 over the text's exact UTF-8 bytes.

All displayed inputs use shared access and remain reusable. An encoding argument is reserved but not implemented. Expanded output that cannot be represented or allocated traps with AU4005; malformed data returns bytes.Error.

Collections

See Collections for ownership and iteration details.

list[T]

APISignatureContract
list[T]()list[T]()Empty list constructor.
list.lenlen() -> int64Element count.
list.is_emptyis_empty() -> booltrue when empty.
list.copycopy() -> list[T]Returns independent owned storage; requires clone-safe T.
list.appendappend(value: own T) -> NoneTransfers value to the end.
list.poppop(index: int64 = -1) -> TRemoves and transfers the normalized position; invalid positions trap.
list.getget(index: int64) -> Option[T]Cloned element after negative-index normalization, or None when out of bounds; requires clone-safe T.
list.setset(index: int64, value: own T) -> TReplaces and transfers out the old element; invalid positions trap.
list.removeremove(value: T) -> NoneRemoves the first equal value; absence traps with AU4008.
list.indexindex(value: T) -> int64Returns the first equal position; absence traps with AU4008.
list.countcount(value: T) -> int64Counts equal elements.
list.swapswap(first: int64, second: int64) -> NoneNormalizes and swaps two positions; invalid positions trap.
list.extendextend(other: own list[T]) -> NoneMoves elements from other into the receiver.
list.insertinsert(index: int64, value: own T) -> NoneInserts before the Python-clamped position.
list.clearclear() -> NoneRemoves all elements.
list.reversereverse() -> NoneReverses in place.
list.sortsort(reverse: bool = false) -> NoneStable in-place natural ordering for T: Ord.
list.sortsort[K](key: def(T) -> K, reverse: bool = false) -> NoneStable key ordering; evaluates each key once before mutation and requires K: Ord.
list.mapmap[U](f: def(T) -> U) -> list[U]Eager shared traversal into a fresh owned result; retains the source.
list.filterfilter(f: def(T) -> bool) -> list[T]Eager shared traversal into a fresh owned result; retains the source and requires clone-safe T.
list.reservereserve(additional: int64) -> NoneEnsures capacity for at least len() + additional.
list[T].with_capacitywith_capacity(minimum: int64) -> list[T]Creates an empty list with at least the requested capacity.

dict[K, V]

APISignatureContract
dict[K, V]()dict[K, V]()Empty dictionary constructor.
dict.lenlen() -> int64Entry count.
dict.is_emptyis_empty() -> booltrue when empty.
dict.copycopy() -> dict[K, V]Returns independent owned storage; requires clone-safe K and V.
dict.getget(key: K) -> Option[V]Cloned value or None when absent; requires clone-safe V.
dict.removeremove(key: K) -> Option[V]Removes an entry and returns the previous value.
dict.keyskeys() -> list[K]Cloned keys in insertion order; requires clone-safe K.
dict.valuesvalues() -> list[V]Cloned values in insertion order; requires clone-safe V.
dict.itemsitems() -> list[(K, V)]Cloned key/value tuples in insertion order; requires clone-safe K and V.
dict.clearclear() -> NoneRemoves all entries.
dict.updateupdate(other: own dict[K, V]) -> NoneTransfers entries from other; matching keys retain their positions.
dict.reservereserve(additional: int64) -> NoneEnsures capacity for at least len() + additional.
dict[K, V].with_capacitywith_capacity(minimum: int64) -> dict[K, V]Creates an empty dictionary with at least the requested capacity.

set[T]

APISignatureContract
set[T]()set[T]()Empty set constructor.
set.lenlen() -> int64Unique value count.
set.is_emptyis_empty() -> booltrue when empty.
set.copycopy() -> set[T]Returns independent owned storage; requires clone-safe T.
set.addadd(value: own T) -> NoneTransfers a value into the set.
set.removeremove(value: T) -> NoneRemoves an equal value; absence traps with AU4008.
set.discarddiscard(value: T) -> NoneRemoves an equal value when present.
set.clearclear() -> NoneRemoves all values.
set.reservereserve(additional: int64) -> NoneEnsures capacity for at least len() + additional.
set[T].with_capacitywith_capacity(minimum: int64) -> set[T]Creates an empty set with at least the requested capacity.

Concurrency

See Concurrency for structured-concurrency semantics.

APISignatureContract
Queue[T]()Queue[T](capacity: int32 = ...)Queue constructor; bounded when capacity is supplied; Accepted ADR-0033 requires T: Transfer.
Queue.putput(value: own T, timeout: Duration = ...) -> Result[None, SendError[T]]Sends a value or returns the unsent value in the error; Accepted ADR-0033 requires T: Transfer.
Queue.try_puttry_put(value: own T) -> Result[None, SendError[T]]Sends without waiting; Accepted ADR-0033 requires T: Transfer.
Queue.getget(timeout: Duration = ...) -> QueueReceive[T]Receives an item, close, timeout, or cancellation outcome; does not itself recheck payload Transfer.
Queue.get_or_noneget_or_none(timeout: Duration = ...) -> Option[T]Some(value) or None for closed, timeout, cancellation, or immediate absence.
Queue.get_orget_or(default: own T, timeout: Duration = ...) -> TValue or fallback.
Queue.closeclose() -> NoneCloses the queue and wakes waiters.
Task.resultresult(timeout: Duration = ...) -> TaskResult[T]Waits for task outcome; consumes the observation right when T is non-repeatable.
Task.result_or_noneresult_or_none(timeout: Duration = ...) -> Option[T]Some(value) or None for failure, timeout, cancellation, or immediate absence; consumes the observation right when T is non-repeatable, including on None.
Task.result_orresult_or(default: own T, timeout: Duration = ...) -> TValue or fallback; consumes the observation right when T is non-repeatable.
TaskGroup()TaskGroup()Task group resource constructor.
TaskGroup.startstart(function, own ...) -> Task[T]Requires every capture and result to be Transfer; accepts inferred or explicit function[Types] / Type.associated_method[Types] targets; starts the child on the guarded 512 KiB default stack.
TaskGroup.start_soonstart_soon(function, own ...) -> NoneApplies the same Transfer and target-specialization rules without returning a handle.
TaskGroup.start_with_stackstart_with_stack(bytes: int64, function, own ...) -> Task[T]Applies the same Transfer and target-specialization rules with an explicit guarded 256 KiB..64 MiB request; 256 KiB is for measured shallow tasks, not the default; Provisional under ADR-0032.
TaskGroup.start_soon_with_stackstart_soon_with_stack(bytes: int64, function, own ...) -> NoneApplies the same rules and explicit guarded range without retaining a handle; 256 KiB is for measured shallow tasks, not the default; Provisional under ADR-0032.
TaskGroup.cancelcancel() -> NoneSignals cancellation to children.

I/O And Filesystem

See I/O Module and Filesystem Module.

APISignatureContract
io.writewrite(text: str) -> Result[None, io.Error]Writes text without a newline.
io.flushflush() -> Result[None, io.Error]Flushes standard output.
io.read_lineread_line() -> Result[Option[str], io.Error]Reads strict UTF-8 without trailing LF/CRLF; Ok(None) on EOF.
fs.existsexists(path: str) -> boolPath existence check.
fs.read_to_stringread_to_string(path: str) -> Result[str, io.Error]Reads UTF-8 text, capped at 256 MiB.
fs.read_bytesread_bytes(path: str) -> Result[list[uint8], io.Error]Reads bytes, capped at 256 MiB.
fs.write_stringwrite_string(path: str, text: str) -> Result[None, io.Error]Creates or replaces a text file.
fs.write_byteswrite_bytes(path: str, bytes: list[uint8]) -> Result[None, io.Error]Creates or replaces a byte file.
fs.append_stringappend_string(path: str, text: str) -> Result[None, io.Error]Appends text.
fs.append_bytesappend_bytes(path: str, bytes: list[uint8]) -> Result[None, io.Error]Appends bytes.
fs.create_dircreate_dir(path: str) -> Result[None, io.Error]Creates one directory.
fs.read_dirread_dir(path: str) -> Result[list[str], io.Error]Returns sorted immediate entry names, with lossy host-path decoding.
fs.remove_fileremove_file(path: str) -> Result[None, io.Error]Removes a file.
fs.openopen(path: str) -> Result[fs.File, io.Error]Opens for reading.
fs.createcreate(path: str) -> Result[fs.File, io.Error]Creates or truncates for writing.
fs.appendappend(path: str) -> Result[fs.File, io.Error]Opens for append, creating if needed.
fs.File.read_allread_all() -> Result[str, io.Error]Reads remaining strict UTF-8 text, capped at 256 MiB.
fs.File.read_bytesread_bytes() -> Result[list[uint8], io.Error]Reads remaining bytes, capped at 256 MiB.
fs.File.write_allwrite_all(text: str) -> Result[None, io.Error]Writes all text.
fs.File.write_byteswrite_bytes(bytes: list[uint8]) -> Result[None, io.Error]Writes all bytes.
fs.File.flushflush() -> Result[None, io.Error]Flushes pending writes.
fs.File.closeclose() -> NoneCloses the handle.

Control-Plane Modules

See Control-Plane Modules.

APISignature
sys.argsargs() -> list[str]
sys.envenv(name: str) -> Option[str]
sys.current_dircurrent_dir() -> Result[str, io.Error]
sys.unix_time_msunix_time_ms() -> int64
sys.monotonic_time_msmonotonic_time_ms() -> int64
path.joinjoin(base: str, child: str) -> str
path.parentparent(path: str) -> Option[str]
path.file_namefile_name(path: str) -> Option[str]
path.extensionextension(path: str) -> Option[str]
path.is_absoluteis_absolute(path: str) -> bool
json.parseparse(text: str) -> Result[json.Value, json.Error]
json.dumpsdumps(value: json.Value, indent: Option[int64] = None) -> str
json.is_nullis_null(value: json.Value) -> bool
json.as_boolas_bool(value: json.Value) -> Option[bool]
json.as_intas_int(value: json.Value) -> Option[int64]
json.as_floatas_float(value: json.Value) -> Option[float64]
json.into_stringinto_string(value: own json.Value) -> Option[str]
json.into_arrayinto_array(value: own json.Value) -> Option[list[json.Value]]
json.into_objectinto_object(value: own json.Value) -> Option[dict[str, json.Value]]
json.is_valid / toml.is_validis_valid(text: str) -> bool
json.stringify_map / toml.stringify_mapstringify_map(value: dict[str, str]) -> Result[str, str]
json.parse_string_map / toml.parse_string_mapparse_string_map(text: str) -> Result[dict[str, str], str]
log.debug/info/warn/error(message: str, fields: dict[str, str]) -> None
trace.event(name: str, fields: dict[str, str]) -> None
metrics.increment(name: str, value: int64) -> None
metrics.get(name: str) -> int64
metrics.reset() -> None
control.retryretry[T, E](worker: def() -> Result[T, E], max_attempts: int32 = 3, initial_backoff: Duration = 0ms) -> Result[T, E]

Metrics are process-global int64 counters; missing names read as zero and overflow is a runtime diagnostic. Dynamic JSON object dumps and bounded JSON/TOML string maps serialize in sorted key order. See JSON Module and the control-plane chapter for exact value, limit, host-string/path, and telemetry-record rules.

control.retry validates at least one attempt and a non-negative, host-representable backoff before invoking the worker. It runs its first attempt immediately, retries every Err with doubling delays, skips zero sleeps, returns the exact last Err, and performs no sleep or multiplication after the final attempt. Worker traps, backoff overflow, and current-task cancellation propagate.

Network Constructors And HTTP Client Helpers

See Network Module for behavior and examples.

APISignature
net.connectconnect(address: str) -> Result[net.TcpStream, io.Error]
net.connect_timeoutconnect_timeout(address: str, timeout: Duration) -> Result[net.TcpStream, io.Error]
net.listenlisten(address: str) -> Result[net.TcpListener, io.Error]
net.udp_bindudp_bind(address: str) -> Result[net.UdpSocket, io.Error]
net.http_listenhttp_listen(address: str) -> Result[net.HttpListener, io.Error]
net.websocket_listenwebsocket_listen(address: str) -> Result[net.WebSocketListener, io.Error]
net.websocket_connectwebsocket_connect(url: str) -> Result[net.WebSocket, io.Error]
net.websocket_connect_timeoutwebsocket_connect_timeout(url: str, timeout: Duration) -> Result[net.WebSocket, io.Error]
net.unix_listenunix_listen(path: str) -> Result[net.UnixListener, io.Error]
net.unix_connectunix_connect(path: str) -> Result[net.UnixStream, io.Error]
net.unix_connect_timeoutunix_connect_timeout(path: str, timeout: Duration) -> Result[net.UnixStream, io.Error]
net.tls_listentls_listen(address: str, cert_pem_path: str, key_pem_path: str) -> Result[net.TlsListener, io.Error]
net.tls_connecttls_connect(address: str, server_name: str, ca_pem_path: str) -> Result[net.TlsStream, io.Error]
net.tls_connect_timeouttls_connect_timeout(address: str, server_name: str, ca_pem_path: str, timeout: Duration) -> Result[net.TlsStream, io.Error]
net.http_request_texthttp_request_text(method: str, url: str, body: str, headers: dict[str, str]) -> Result[net.HttpResponse, io.Error]
net.http_request_text_timeouthttp_request_text_timeout(method: str, url: str, body: str, headers: dict[str, str], timeout: Duration) -> Result[net.HttpResponse, io.Error]
net.http_request_byteshttp_request_bytes(method: str, url: str, bytes: list[uint8], headers: dict[str, str]) -> Result[net.HttpResponse, io.Error]
net.http_request_bytes_timeouthttp_request_bytes_timeout(method: str, url: str, bytes: list[uint8], headers: dict[str, str], timeout: Duration) -> Result[net.HttpResponse, io.Error]

Network Resource Methods

Bounded stream read counts are 1..=67108864; UDP receive counts are 1..=65535. Incoming HTTP parsing accepts at most 64 headers and 16 MiB of wire data per message; WebSocket limits are 64 MiB per message and 16 MiB per frame/write buffer. See Network Module for timeout, EOF, UTF-8, cancellation, and repeated-header contracts.

TypeAPISignature
net.TcpListeneracceptaccept(timeout: Duration = ...) -> Result[net.TcpStream, io.Error]
net.TcpListenerlocal_addrlocal_addr() -> Result[str, io.Error]
net.TcpListenercloseclose() -> None
net.TcpStreamread_allread_all(timeout: Duration = ...) -> Result[str, io.Error]
net.TcpStreamread_lineread_line(timeout: Duration = ...) -> Result[Option[str], io.Error]
net.TcpStreamread_bytesread_bytes(max_bytes: int32, timeout: Duration = ...) -> Result[Option[list[uint8]], io.Error]
net.TcpStreamread_exactread_exact(count: int32, timeout: Duration = ...) -> Result[list[uint8], io.Error]
net.TcpStreamwrite_allwrite_all(text: str, timeout: Duration = ...) -> Result[None, io.Error]
net.TcpStreamwrite_byteswrite_bytes(bytes: list[uint8], timeout: Duration = ...) -> Result[None, io.Error]
net.TcpStreamflushflush() -> Result[None, io.Error]
net.TcpStreamlocal_addrlocal_addr() -> Result[str, io.Error]
net.TcpStreampeer_addrpeer_addr() -> Result[str, io.Error]
net.TcpStreamshutdown_readshutdown_read() -> Result[None, io.Error]
net.TcpStreamshutdown_writeshutdown_write() -> Result[None, io.Error]
net.TcpStreamshutdown_bothshutdown_both() -> Result[None, io.Error]
net.TcpStreamcloseclose() -> None
net.UdpSocketsend_textsend_text(address: str, text: str, timeout: Duration = ...) -> Result[None, io.Error]
net.UdpSocketsend_bytessend_bytes(address: str, bytes: list[uint8], timeout: Duration = ...) -> Result[None, io.Error]
net.UdpSocketrecvrecv(max_bytes: int32, timeout: Duration = ...) -> Result[Option[list[uint8]], io.Error]
net.UdpSocketrecv_fromrecv_from(max_bytes: int32, timeout: Duration = ...) -> Result[Option[net.UdpDatagram], io.Error]
net.UdpSocketlocal_addrlocal_addr() -> Result[str, io.Error]
net.UdpSocketpeer_addrpeer_addr() -> Result[str, io.Error]
net.UdpSocketcloseclose() -> None
net.UdpDatagramaddressaddress() -> str
net.UdpDatagrambytesbytes() -> list[uint8]
net.UdpDatagramtexttext() -> Result[str, io.Error]
net.HttpListeneracceptaccept(timeout: Duration = ...) -> Result[net.HttpExchange, io.Error]
net.HttpListenerlocal_addrlocal_addr() -> Result[str, io.Error]
net.HttpListenercloseclose() -> None
net.HttpExchangemethodmethod() -> str
net.HttpExchangepathpath() -> str
net.HttpExchangeheadersheaders() -> dict[str, str]
net.HttpExchangebody_textbody_text() -> Result[str, io.Error]
net.HttpExchangebody_bytesbody_bytes() -> list[uint8]
net.HttpExchangerespond_textrespond_text(status: int32, text: own str, headers: own dict[str, str]) -> Result[None, io.Error]
net.HttpExchangerespond_bytesrespond_bytes(status: int32, bytes: own list[uint8], headers: own dict[str, str]) -> Result[None, io.Error]
net.HttpResponsestatusstatus() -> int32
net.HttpResponsereasonreason() -> str
net.HttpResponseheadersheaders() -> dict[str, str]
net.HttpResponsetexttext() -> Result[str, io.Error]
net.HttpResponsebytesbytes() -> list[uint8]
net.WebSocketListeneracceptaccept(timeout: Duration = ...) -> Result[net.WebSocket, io.Error]
net.WebSocketListenerlocal_addrlocal_addr() -> Result[str, io.Error]
net.WebSocketsend_textsend_text(text: str, timeout: Duration = ...) -> Result[None, io.Error]
net.WebSocketsend_bytessend_bytes(bytes: list[uint8], timeout: Duration = ...) -> Result[None, io.Error]
net.WebSocketrecv_textrecv_text(timeout: Duration = ...) -> Result[Option[str], io.Error]
net.WebSocketrecv_bytesrecv_bytes(timeout: Duration = ...) -> Result[Option[list[uint8]], io.Error]
net.WebSocketcloseclose() -> None
net.UnixListeneracceptaccept(timeout: Duration = ...) -> Result[net.UnixStream, io.Error]
net.UnixListenercloseclose() -> None
net.UnixStreamread_lineread_line(timeout: Duration = ...) -> Result[Option[str], io.Error]
net.UnixStreamread_exactread_exact(count: int32, timeout: Duration = ...) -> Result[list[uint8], io.Error]
net.UnixStreamwrite_allwrite_all(text: str, timeout: Duration = ...) -> Result[None, io.Error]
net.UnixStreamcloseclose() -> None
net.TlsListeneracceptaccept(timeout: Duration = ...) -> Result[net.TlsStream, io.Error]
net.TlsListenerlocal_addrlocal_addr() -> Result[str, io.Error]
net.TlsListenercloseclose() -> None
net.TlsStreamread_lineread_line(timeout: Duration = ...) -> Result[Option[str], io.Error]
net.TlsStreamread_exactread_exact(count: int32, timeout: Duration = ...) -> Result[list[uint8], io.Error]
net.TlsStreamwrite_allwrite_all(text: str, timeout: Duration = ...) -> Result[None, io.Error]
net.TlsStreamcloseclose() -> None

Process

See Process Module for defaults, groups, and supervisor behavior.

APISignature
process.inheritinherit() -> process.Stdio
process.nullnull() -> process.Stdio
process.pipepipe() -> process.Stdio
process.supervisorsupervisor() -> process.Supervisor
process.startstart(command: list[str], cwd: Option[str] = ..., env: dict[str, str] = ..., stdin: process.Stdio = ..., stdout: process.Stdio = ..., stderr: process.Stdio = ..., group: bool = ...) -> Result[process.Child, process.Error]
process.runrun(command: list[str], cwd: Option[str] = ..., env: dict[str, str] = ..., stdin: process.Stdio = ..., stdout: process.Stdio = ..., stderr: process.Stdio = ..., timeout: Duration = ..., group: bool = ...) -> Result[process.Completed, process.Error]
process.Child.stdinstdin() -> Option[process.Pipe]
process.Child.stdoutstdout() -> Option[process.Pipe]
process.Child.stderrstderr() -> Option[process.Pipe]
process.Child.waitwait(timeout: Duration = ...) -> process.Wait
process.Child.wait_or_nonewait_or_none(timeout: Duration = ...) -> Result[Option[process.ExitStatus], process.Error]
process.Child.wait_okwait_ok(timeout: Duration = ...) -> Result[process.ExitStatus, process.Error]
process.Child.killkill() -> Result[None, process.Error]
process.Child.terminateterminate() -> Result[None, process.Error]
process.Child.closeclose() -> None
process.Pipe.read_allread_all() -> Result[str, process.Error]
process.Pipe.read_lineread_line(timeout: Duration = ...) -> Result[Option[str], process.Error]
process.Pipe.read_bytesread_bytes(max_bytes: int32, timeout: Duration = ...) -> Result[Option[list[uint8]], process.Error]
process.Pipe.write_allwrite_all(text: str, timeout: Duration = ...) -> Result[None, process.Error]
process.Pipe.write_byteswrite_bytes(bytes: list[uint8], timeout: Duration = ...) -> Result[None, process.Error]
process.Pipe.flushflush() -> Result[None, process.Error]
process.Pipe.closeclose() -> None
process.Completed.statusstatus() -> process.ExitStatus
process.Completed.successsuccess() -> bool
process.Completed.stdoutstdout() -> str
process.Completed.stdout_bytesstdout_bytes() -> list[uint8]
process.Completed.stderrstderr() -> str
process.Completed.stderr_bytesstderr_bytes() -> list[uint8]
process.Completed.checkcheck() -> Result[None, process.Error]
process.Supervisor.startstart(name: own str, command: own list[str], cwd: own Option[str] = ..., env: own dict[str, str] = ..., stdin: own process.Stdio = ..., stdout: own process.Stdio = ..., stderr: own process.Stdio = ..., restart: own process.RestartPolicy = ..., backoff: own Duration = ..., max_restarts: own int32 = ..., group: own bool = ...) -> Result[None, process.Error]
process.Supervisor.waitwait(timeout: Duration = ...) -> process.SupervisorWait
process.Supervisor.wait_or_nonewait_or_none(timeout: Duration = ...) -> Result[Option[process.SupervisorEvent], process.Error]
process.Supervisor.stopstop() -> Result[None, process.Error]
process.Supervisor.is_emptyis_empty() -> bool
process.Supervisor.closeclose() -> None

Pipe read_bytes returns Ok(None) only at EOF; timeout and cancellation are process.Error variants. Whole/captured reads are capped at 64 MiB. process.Completed.stdout() and .stderr() raise a runtime diagnostic on invalid UTF-8, so byte accessors are the safe boundary for untrusted output.

Builtin Enum Variants

TypeVariants
Option[T]Some(value: own T), None
Result[T, E]Ok(value: own T), Err(error: own E)
SendError[T]Closed(value: own T), Cancelled(value: own T), TimedOut(value: own T), Full(value: own T)
QueueReceive[T]Item(value: own T), Closed, TimedOut, Cancelled
TaskResult[T]Ready(value: own T), Error(message: own str), TimedOut, Cancelled
SelectOutcome[Q, T]Queue(index: own int64, outcome: own QueueReceive[Q]), Task(index: own int64, outcome: own TaskResult[T]), Deadline(index: own int64), Cancelled
WaitAny[T]Ready(index: own int64, value: own T), Error(index: own int64, message: own str), TimedOut, Cancelled
WaitAll[T]Ready(values: own list[T]), Error(index: own int64, message: own str), TimedOut, Cancelled
bytes.ErrorInvalidUtf8(index: own int32), InvalidHexLength(length: own int32), InvalidHexDigit(index: own int32, byte: own uint8), InvalidBase64(index: own int32)
io.ErrorNotFound, PermissionDenied, AlreadyExists, IsDirectory, ConnectionRefused, ConnectionReset, ConnectionAborted, NotConnected, AddrInUse, AddrNotAvailable, BrokenPipe, TimedOut, WouldBlock, UnexpectedEof, InvalidInput, InvalidData, Closed, Cancelled, Other(message: own str)
process.StdioInherit, Null, Pipe
process.ExitStatusExited(code: own int32), Signaled(signal: own int32)
process.WaitExited(status: own process.ExitStatus), TimedOut, Cancelled, Failed(error: own process.Error)
process.RestartPolicyNever, OnFailure, Always
process.ErrorNoCommand, TimedOut, Cancelled, Io(error: own io.Error), Spawn(message: own str), Other(message: own str)
process.SupervisorEventExited(name: own str, status: own process.ExitStatus, restart_count: own int32), Restarted(name: own str, status: own process.ExitStatus, restart_count: own int32), Failed(name: own str, error: own process.Error, restart_count: own int32)
process.SupervisorWaitEvent(event: own process.SupervisorEvent), TimedOut, Cancelled

Aura 0.3.2 technical preview. Implementation baseline: 837eb9756ed9efdca275d960edf12317fff1aa9c.