Standard library API
API listing generated from the public items and doc comments of the standard library sources (library/). Behavior and guarantees are defined in the standard library specification.
bare
The lowest layer: pointers, memory, FFI.
bareraw pointers, transmute, raw allocation, pinning and volatile access, over the runtime'sextern "nabi"symbols only.bare::allocraw allocation outside the GC.bare::ffiC's types (types, also in the prelude), errno (errno), Nabi values C holds (handle), NUL-terminated C strings (wide:wchar_tones), loading shared libraries (library);witis what the WIT bindings run on;objc, Objective-C objects, exists only on Apple targets.bare::ffi::errnothe C library's errno and Windows'GetLastErroras the last#[errno]call left them.bare::ffi::handleNabi values C code holds as avoid*.bare::ffi::libraryshared libraries loaded at run time:dlopenon Unix,LoadLibraryWon Windows.bare::ffi::objcObjective-C objects on Apple targets.bare::ffi::objc::blockNabi closures as Objective-C blocks, laid out as the Apple block ABI says.bare::ffi::objc::dispatchGrand Central Dispatch: run a closure on the main queue or a global one, through aBlock.bare::ffi::objc::errorNSError, what a method that reports through a lastNSError **parameter throws.bare::ffi::objc::stringNSStringandstr.bare::ffi::objc::subclassclasses made at run time (objc_allocateClassPair): Nabi functions as an Objective-C class's methods, for delegates and the classes an API wants subclassed.bare::ffi::typesC's integer and float types under their C names, as the target's C compiler sizes them.bare::ffi::wideNUL-terminatedwchar_tstrings: UTF-16 on Windows (theWAPIs), one unit per char (UTF-32) elsewhere.bare::ffi::witwhat the generated WIT bindings run on: linear-memory access at canonical ABI addresses (i32), the blocks strings and lists lower into, resource handles anderror-context.bare::gcthe collector's controls, and keeping GC objects in place for raw pointers.bare::memraw memory operations,Podand bit casts.bare::ptrraw pointers.bare::volatileaccesses the optimizer keeps exactly as written: MMIO, signal flags, DMA buffers.
core
Collections, numbers, iterators, formatting, synchronization, tasks. Available to all code automatically.
corecore tier (foundation) - safe, target-independent.core::arrayClone / Copy / Default / Debug / PartialEq / Eq / Hash for fixed arrays[T; N], element-wise, and PartialOrd / Ord, lexicographic; andArray<T, N>, the n-dimensional array.core::benchthe enginenabi benchdrives.core::channelmessage passing between threads.core::cmptotal equality, ordering and hashing.core::collectionsList / Dict / Set / Slice, Deque, BinaryHeap, SortedDict / SortedSet, and the frozen (read-only,Sync) List / Dict / Set.core::collections::broadcastthe element-wise dot operators onList<T>:List op List(same length, else a panic),List op TandT op List(the scalar applies to every element).core::collections::dequeDeque<T>, a growable ring buffer with O(1) push and pop at both ends.core::collections::dictDict<K, V, S>, a hash map hashing withS(the process-keyedRandomStateby default), compact: entries are appended to dense key / value / hash arrays, and a power-of-two index of linear-probed slots maps a hash to its entry.core::collections::frozenFrozenList,FrozenDictandFrozenSet: a collection that no one can change any more, shared between threads without a lock and without a copy.core::collections::heapBinaryHeap<T>, a priority queue over aListlaid out as an implicit binary tree.core::collections::listList<T>, a growable array: one object holding the length, the capacity and the current element buffer, swapped for a bigger one on growth.core::collections::setSet<T, S>, a hash set overDict<T, bool, S>, so it iterates in insertion order.core::collections::sliceSlice<T>, a zero-copy view; elementiisbuf[start + i * stride], and the view keeps its buffer alive.core::collections::sortedSortedDict<K, V>andSortedSet<T>: ordered byK: Ord, kept in a B-tree.core::convertconversion traits and primitive impls.core::cryptoCryptographic algorithms: pure computation, no OS (randomness isstd::random).core::crypto::aeadAuthenticated encryption with associated data: AES-GCM (NIST SP 800-38D, 96-bit nonces) and ChaCha20-Poly1305 (RFC 8439).core::crypto::ecdsaECDSA (FIPS 186-5) on P-256 and P-384: verification, and signing with RFC 6979 deterministic nonces.core::crypto::ed25519Ed25519 (RFC 8032 5.1): pure EdDSA over edwards25519 with SHA-512.core::crypto::hkdfHKDF (RFC 5869) over anyHashAlgorithm:extracta pseudorandom key,expandit into output keying material.core::crypto::hmacHMAC (RFC 2104) over anyHashAlgorithm, SHA-2 or SHA-3.core::crypto::mlkemML-KEM-768 (FIPS 203): k = 3, eta1 = eta2 = 2, du = 10, dv = 4.core::crypto::rsaRSA (RFC 8017): PKCS #1 v1.5 and PSS verification and signing (MGF1 with the message hash), moduli of 2048 to 4096 bits.core::crypto::secretSecret storage: a buffer in the large-object space, so the collector never moves or copies it, zeroed bywipe, byusingrelease and by the collection that frees it (nabi_gc_secret_new).core::crypto::sha2SHA-2 (FIPS 180-4): SHA-256, SHA-384 and SHA-512.core::crypto::sha3SHA-3 (FIPS 202): SHA3-256, SHA3-512 and the SHAKE128 / SHAKE256 extendable-output functions, all over Keccak-f[1600].core::crypto::x25519X25519 (RFC 7748): Diffie-Hellman on Curve25519's u coordinate.core::encodingbytes as text (RFC 4648):hexandbase64.core::encoding::base64base64 (RFC 4648 sections 4 and 5).core::encoding::hexbase16 (RFC 4648 section 8): two digits per byte.core::errorResult<T, E>, an error kept as a value.core::fmtFormatter,Display/Debug,FormatSpecand the f-string lowering targets.core::futureFuture/Poll/Context/Waker/IntoFuture.core::hashwhat aHashimpl writes to:Hasher,BuildHasher, the process-keyedRandomStatethatDictandSetdefault to with its SipHash-1-3DefaultHasher, and the caller-keyedSipHasher13/SipHasher24, whose output is stable.core::hinthints the optimizer honors.core::indexIndexing + slicing traits.core::ioIoError, the byte-stream traitsRead,BufRead,Write,Seekand their async twins, the buffers,Cursor,copyand the standard streams.core::iterIterator + IntoIterator + FromIterator.core::markerMarker traits used by#[derive(..)]and other compiler-driven semantics.core::numthe primitive types' operator / comparison trait impls.core::num::bigfloatfloat.core::num::bigintint, the arbitrary-precision integer.core::num::halff16(IEEE 754 binary16) andbf16(bfloat16), storage types held as their 16 bits.core::num::nichewrappers that leave out values:NonZero<T>(0),NonNan<F>(NaN),Finite<F>(NaN, +/-inf),Positive<T>(negatives).core::opsOperator traits: the source of every operator token.core::panicthe compiler hookspanic_fn/oom_fn/unreachable_fn: print a message to stderr and exit 101.core::pardata-parallel helpers, on the process's task executor (core::task): from async code on the worker it runs on, from sync code with the caller as a guest worker.core::preludethe names every file outside the library sees bare: user code gets an implicituse core::prelude::*;unless the file says#![no_implicit_nabi].core::printprint/println/eprint/eprintln,dbganddisplay(the prelude names them, so they need nouse).core::rangeRange / RangeInclusive / RangeFrom / RangeTo / RangeToInclusive / RangeFull.core::reflectReflect/Inspect.core::reflect::attrruntime attributes: values of a#[runtime_attribute(name)]struct written as#[name(..)]on a type, field or variant, kept in read-only data.core::reflect::fieldField, one field of a struct or variant.core::reflect::infoTypeInfo, a type's description.core::simdportable SIMD:Simd<T, N>holdsNlanes of a numberT, and its operators work on every lane at once.core::strstrmethods and trait impls.core::str::unicodeUnicode text onstr: normalization forms, full case folding, and segmentation into grapheme clusters (user-perceived characters) and words.core::streamStream/IntoStream/FromStream.core::syncconcurrency primitives.core::tasktasks on the work-stealing executor andblock_on;Duration/Instantarecore::time.core::timeDuration/Instant.core::tupleClone / Copy / Default / Debug / PartialEq / Eq / Hash for tuples of 1 to 12 elements, component-wise, and PartialOrd / Ord, lexicographic.
std
Files, networking, time, threads, processes, environment, NABION.
stdthe target-dependent tier.std::envarguments, environment variables, directories.std::fsfiles and directories over theopenatfamily, so aDirhandle is a capability.std::nabionNABION (Nabi Object Notation,.nabion): one value written in Nabi literal syntax.std::netTCP / UDP sockets, addresses, DNS.std::net::tlsTLS 1.3, implemented here in Nabi oncore::crypto: no OS or external TLS library.std::oswhat only some OSes have.std::os::linuxLinux-only parts of the cross-platform modules.std::os::linux::netLinux-only socket calls.std::os::linux::processLinux-only parts ofprocess.std::os::unixUnix-only parts of the cross-platform modules.std::os::unix::fsthe Unix side of the cross-platform fs types: permission bits, the open functions'osrecords, andopenat(2)itself with itsO_*flags.std::os::unix::ioraw file descriptors.std::os::unix::netUnix domain sockets.std::os::unix::processUnix-only parts ofprocess.std::os::windowsWindows-only parts of the cross-platform modules.std::os::windows::fsthe Windows side of the cross-platform fs types: the open functions'osrecords andCreateFile2itself with its constants.std::os::windows::ioraw handles and sockets.std::os::windows::processWindows-only parts ofprocess.std::panica hook that sees every panic before the process ends (or, under#[on_panic], before the C caller gets its value back).std::pathPath, a UTF-8 path value with Python-style/joining.std::pluginload a plugin into this program and call its functions.std::processchild processes.std::randomcryptographically secure random bytes from the OS (getrandomon Linux,getentropyon macOS,BCryptGenRandomon Windows,random_geton WASI), seedable generators (Rng) with ranges of any integer type and the common distributions, and one-call forms over a shared generator.std::reloadhot reload undernabi dev: where changes apply, code that runs around them, and state that lives through them.std::threadOS threads, 1:1.std::timethe wall clock (SystemTime), the boot clock (BootTime), and the civil calendar:Date,Time,DateTime,Offset,TimeZoneandZoned, with ISO 8601 / RFC 3339 text and strftime-styleformat/parse_with.std::witthe component model's async ABI (WASI preview 3) for the bindingsffi::wit::import/ffi::wit::exportgenerate: it runs on the executor, so it lives abovebare::ffi::wit.