Standard Library Reference
alias WChar @if(env::WIN32) = Char16alias WChar @if(!env::WIN32) = Char32struct DivResultstruct LongDivResultstruct Fpos_t @if(!env::WIN32)struct Mbstate_t @if(!env::WIN32)fn Errno errno()fn void errno_set(Errno e)typedef Errno = inline CIntalias TerminateFunction = fn void()alias CompareFunction = fn int(void*, void*)alias JmpBuf = uptr[$$JMP_BUF_SIZE]alias Fd = CIntalias Fpos_t @if(env::WIN32) = longalias SignalFunction = fn void(CInt)alias Time_t = $typefrom(env::WIN32 ? long.typeid : CLong.typeid)alias Off_t = $typefrom(env::WIN32 ? int.typeid : usz.typeid)alias CFile = void*macro bool libc_S_ISTYPE(value, mask) @builtinalias SeekIndex = CLongstruct Tmstruct TimeSpecalias Clock_t @if(env::WIN32) = intalias Clock_t @if(!env::WIN32) = CLongalias TimeOffset @if(env::WASI) = intalias TimeOffset @if(!env::WASI) = CLongfn TimeSpec NanoDuration.to_timespec(self) @inlinefn TimeSpec Duration.to_timespec(self) @inlinefn TimeSpec Time.to_timespec(self) @inlinelibc @if(!env::LIBC)
Section titled “libc @if(!env::LIBC)”fn void longjmp(JmpBuf* buffer, CInt value) @weak @extern("longjmp") @nostripfn CInt setjmp(JmpBuf* buffer) @weak @extern("setjmp") @nostripfn void* malloc(usz size) @weak @extern("malloc") @nostripfn void* calloc(usz count, usz size) @weak @extern("calloc") @nostripfn void* free(void*) @weak @extern("free")fn void* realloc(void* ptr, usz size) @weak @extern("realloc") @nostripfn void* memcpy(void* dest, void* src, usz n) @weak @extern("memcpy") @nostripfn void* memmove(void* dest, void* src, usz n) @weak @extern("memmove") @nostripfn void* memset(void* dest, CInt value, usz n) @weak @extern("memset") @nostripfn int fseek(CFile stream, SeekIndex offset, int whence) @weak @extern("fseek") @nostripfn CFile fopen(ZString filename, ZString mode) @weak @extern("fopen") @nostripfn CFile freopen(ZString filename, ZString mode, CFile stream) @weak @extern("fopen") @nostripfn usz fwrite(void* ptr, usz size, usz nmemb, CFile stream) @weak @extern("fwrite") @nostripfn usz fread(void* ptr, usz size, usz nmemb, CFile stream) @weak @extern("fread") @nostripfn CFile fclose(CFile) @weak @extern("fclose") @nostripfn int fflush(CFile stream) @weak @extern("fflush") @nostripfn int fputc(int c, CFile stream) @weak @extern("fputc") @nostripfn char* fgets(ZString str, int n, CFile stream) @weak @extern("fgets") @nostripfn int fgetc(CFile stream) @weak @extern("fgetc") @nostripfn int feof(CFile stream) @weak @extern("feof") @nostripfn int putc(int c, CFile stream) @weak @extern("putc") @nostripfn int putchar(int c) @weak @extern("putchar") @nostripfn int puts(ZString str) @weak @extern("puts") @nostriplibc @if(env::ANDROID)
Section titled “libc @if(env::ANDROID)”alias Blksize_t = $typefrom(env::X86_64 ? long.typeid : CInt.typeid)alias Nlink_t = $typefrom(env::X86_64 ? ulong.typeid : CUInt.typeid)alias Blkcnt_t = longalias Ino_t = ulongalias Dev_t = ulongalias Mode_t = uintalias Ino64_t = ulongalias Blkcnt64_t = longstruct Stat @if(env::X86_64)struct Stat @if(!env::X86_64)extern fn CInt stat(ZString path, Stat* stat)libc @if(env::DARWIN || env::FREEBSD)
Section titled “libc @if(env::DARWIN || env::FREEBSD)”extern fn usz malloc_size(void* ptr) @if(!env::FREEBSD)macro CFile stdout()macro CFile stderr()libc @if(env::DARWIN)
Section titled “libc @if(env::DARWIN)”alias Dev_t = intalias Mode_t = ushortalias Nlink_t = ushortalias Blkcnt_t = longalias Blksize_t = intalias Ino_t = ulongstruct Statextern fn int stat(ZString str, Stat* stat) @extern("stat64")libc @if(env::FREEBSD)
Section titled “libc @if(env::FREEBSD)”alias Blksize_t = intalias Nlink_t = $typefrom(env::X86_64 ? ulong.typeid : CUInt.typeid)alias Dev_t = ulongalias Ino_t = ulongalias Mode_t = ushortalias Blkcnt_t = longalias Fflags_t = uintstruct Stat @if(env::X86_64)struct Stat @if(!env::X86_64)extern fn CInt stat(ZString path, Stat* stat)libc @if(env::LIBC)
Section titled “libc @if(env::LIBC)”extern fn void abort()macro CFile stdout()macro CFile stderr()libc @if(env::LINUX)
Section titled “libc @if(env::LINUX)”alias Blksize_t = $typefrom(env::X86_64 ? long.typeid : CInt.typeid)alias Nlink_t = $typefrom(env::X86_64 ? ulong.typeid : CUInt.typeid)alias Blkcnt_t = longalias Ino_t = ulongalias Dev_t = ulongalias Mode_t = uintalias Ino64_t = ulongalias Blkcnt64_t = longstruct Stat @if(env::X86_64)struct Stat @if(!env::X86_64)extern fn CInt stat(ZString path, Stat* stat)libc @if(env::OPENBSD)
Section titled “libc @if(env::OPENBSD)”alias Blksize_t = intalias Nlink_t = $typefrom(env::X86_64 ? uint.typeid : CUInt.typeid)alias Dev_t = intalias Ino_t = ulongalias Mode_t = uintalias Blkcnt_t = longalias Fflags_t = uintstruct Stat @if(env::X86_64)struct Stat @if(!env::X86_64)extern fn CInt stat(ZString path, Stat* stat)libc @if(env::POSIX)
Section titled “libc @if(env::POSIX)”extern fn CInt shutdown(Fd sockfd, CInt how)struct Stack_textern fn CInt sigaltstack(Stack_t* ss, Stack_t* old_ss)libc @if(env::WIN32)
Section titled “libc @if(env::WIN32)”alias fdopen = _fdopenalias close = _closealias fileno = _filenoalias isatty = _isattyalias difftime = _difftime64alias fseek = _fseeki64alias ftell = _ftelli64alias timegm = _mkgmtime64alias mktime = _mktime64extern fn CFile __acrt_iob_func(CInt c)extern fn CInt get_system_info(SystemInfo*) @extern("GetSystemInfo")libc::errno
Section titled “libc::errno”libc::errno @if(!env::WIN32 && !env::DARWIN)
Section titled “libc::errno @if(!env::WIN32 && !env::DARWIN)”libc::errno @if(env::DARWIN)
Section titled “libc::errno @if(env::DARWIN)”libc::errno @if(env::WIN32)
Section titled “libc::errno @if(env::WIN32)”libc::os @if(env::LIBC)
Section titled “libc::os @if(env::LIBC)”extern fn int* __errno_location() @if(env::LINUX)macro void errno_set(int err) @if(env::WIN32)extern fn void _get_errno(int* result) @if(env::WIN32)libc::termios @if(!env::LIBC ||| !env::POSIX)
Section titled “libc::termios @if(!env::LIBC ||| !env::POSIX)”typedef Cc = chartypedef Speed = CUInttypedef Tcflags = CUIntstruct Termiosfn CInt tcgetattr(Fd fd, Termios* self)fn CInt tcsetattr(Fd fd, CInt optional_actions, Termios* self)fn CInt tcsendbreak(Fd fd, CInt duration)fn CInt tcdrain(Fd fd)fn CInt tcflush(Fd fd, CInt queue_selector)fn CInt tcflow(Fd fd, CInt action)fn Speed cfgetospeed(Termios* self)fn Speed cfgetispeed(Termios* self)fn CInt cfsetospeed(Termios* self, Speed speed)fn CInt cfsetispeed(Termios* self, Speed speed)fn int sendBreak(Fd fd, int duration)fn int drain(Fd fd)fn int flush(Fd fd, int queue_selector)fn int flow(Fd fd, int action)fn Speed Termios.getOSpeed(Termios* self)fn Speed Termios.getISpeed(Termios* self)fn int Termios.setOSpeed(Termios* self, Speed speed)fn int Termios.setISpeed(Termios* self, Speed speed)fn int Termios.getAttr(Termios* self, Fd fd)fn int Termios.setAttr(Termios* self, Fd fd, int optional_actions)libc::termios @if(env::LIBC &&& env::POSIX)
Section titled “libc::termios @if(env::LIBC &&& env::POSIX)”fn int sendBreak(Fd fd, int duration)fn int drain(Fd fd)fn int flush(Fd fd, int queue_selector)fn int flow(Fd fd, int action)fn Speed Termios.getOSpeed(Termios* self)fn Speed Termios.getISpeed(Termios* self)fn int Termios.setOSpeed(Termios* self, Speed speed)fn int Termios.setISpeed(Termios* self, Speed speed)fn int Termios.getAttr(Termios* self, Fd fd)fn int Termios.setAttr(Termios* self, Fd fd, Tcactions optional_actions)std::ascii
Section titled “std::ascii”macro bool in_range_m(c, start, len)macro bool is_lower_m(c)macro bool is_upper_m(c)macro bool is_digit_m(c)macro bool is_bdigit_m(c)macro bool is_odigit_m(c)macro bool is_xdigit_m(c)macro bool is_alpha_m(c)macro bool is_print_m(c)macro bool is_graph_m(c)macro bool is_space_m(c)macro bool is_alnum_m(c)macro bool is_punct_m(c)macro bool is_blank_m(c)macro bool is_cntrl_m(c)macro to_lower_m(c)macro to_upper_m(c)fn bool in_range(char c, char start, char len)fn bool char.in_range(char c, char start, char len)fn bool uint.in_range(uint c, uint start, uint len)fn bool uint.is_lower(uint c) @deprecatedfn bool uint.is_upper(uint c) @deprecatedfn bool uint.is_digit(uint c) @deprecatedfn bool uint.is_bdigit(uint c) @deprecatedfn bool uint.is_odigit(uint c) @deprecatedfn bool uint.is_xdigit(uint c) @deprecatedfn bool uint.is_alpha(uint c) @deprecatedfn bool uint.is_print(uint c) @deprecatedfn bool uint.is_graph(uint c) @deprecatedfn bool uint.is_space(uint c) @deprecatedfn bool uint.is_alnum(uint c) @deprecatedfn bool uint.is_punct(uint c) @deprecatedfn bool uint.is_blank(uint c) @deprecatedfn bool uint.is_cntrl(uint c) @deprecatedfn uint uint.to_lower(uint c) @deprecatedfn uint uint.to_upper(uint c) @deprecatedstd::atomic
Section titled “std::atomic”macro bool is_native_atomic_type($Type)macro fetch_add(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)macro fetch_sub(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)macro fetch_mul(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT)macro fetch_div(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT)macro fetch_or(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)macro fetch_xor(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)macro fetch_and(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)macro fetch_shift_right(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT)macro fetch_shift_left(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT)macro flag_set(ptr, AtomicOrdering $ordering = SEQ_CONSISTENT)macro flag_clear(ptr, AtomicOrdering $ordering = SEQ_CONSISTENT)macro fetch_max(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)macro fetch_min(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)macro @__atomic_compare_exchange_ordering_failure(ptr, expected, desired, $success, failure, $alignment)macro @__atomic_compare_exchange_ordering_success(ptr, expected, desired, success, failure, $alignment)fn CInt __atomic_compare_exchange(CInt size, any ptr, any expected, any desired, CInt success, CInt failure) @weak @export("__atomic_compare_exchange")std::atomic::types{Type}
Section titled “std::atomic::types{Type}”struct Atomicmacro Type Atomic.load(&self, AtomicOrdering ordering = SEQ_CONSISTENT)macro void Atomic.store(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)macro Type Atomic.add(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)macro Type Atomic.sub(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)macro Type Atomic.mul(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)macro Type Atomic.div(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)macro Type Atomic.max(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)macro Type Atomic.min(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)macro Type Atomic.or(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) != FLOAT)macro Type Atomic.xor(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) != FLOAT)macro Type Atomic.and(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) != FLOAT)macro Type Atomic.shr(&self, Type amount, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) != FLOAT)macro Type Atomic.shl(&self, Type amount, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) != FLOAT)macro Type Atomic.set(&self, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) == BOOL)macro Type Atomic.clear(&self, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) == BOOL)std::bits
Section titled “std::bits”macro reverse(i)macro bswap(i) @builtinmacro uint[<*>].popcount(self)macro uint[<*>].ctz(self)macro uint[<*>].clz(self)macro uint[<*>] uint[<*>].fshl(hi, uint[<*>] lo, uint[<*>] shift)macro uint[<*>] uint[<*>].fshr(hi, uint[<*>] lo, uint[<*>] shift)macro uint[<*>] uint[<*>].rotl(self, uint[<*>] shift)macro uint[<*>] uint[<*>].rotr(self, uint[<*>] shift)macro int[<*>].popcount(self)macro int[<*>].ctz(self)macro int[<*>].clz(self)macro int[<*>] int[<*>].fshl(hi, int[<*>] lo, int[<*>] shift)macro int[<*>] int[<*>].fshr(hi, int[<*>] lo, int[<*>] shift)macro int[<*>] int[<*>].rotl(self, int[<*>] shift)macro int[<*>] int[<*>].rotr(self, int[<*>] shift)macro ushort[<*>].popcount(self)macro ushort[<*>].ctz(self)macro ushort[<*>].clz(self)macro ushort[<*>] ushort[<*>].fshl(hi, ushort[<*>] lo, ushort[<*>] shift)macro ushort[<*>] ushort[<*>].fshr(hi, ushort[<*>] lo, ushort[<*>] shift)macro ushort[<*>] ushort[<*>].rotl(self, ushort[<*>] shift)macro ushort[<*>] ushort[<*>].rotr(self, ushort[<*>] shift)macro short[<*>].popcount(self)macro short[<*>].ctz(self)macro short[<*>].clz(self)macro short[<*>] short[<*>].fshl(hi, short[<*>] lo, short[<*>] shift)macro short[<*>] short[<*>].fshr(hi, short[<*>] lo, short[<*>] shift)macro short[<*>] short[<*>].rotl(self, short[<*>] shift)macro short[<*>] short[<*>].rotr(self, short[<*>] shift)macro char[<*>].popcount(self)macro char[<*>].ctz(self)macro char[<*>].clz(self)macro char[<*>] char[<*>].fshl(hi, char[<*>] lo, char[<*>] shift)macro char[<*>] char[<*>].fshr(hi, char[<*>] lo, char[<*>] shift)macro char[<*>] char[<*>].rotl(self, char[<*>] shift)macro char[<*>] char[<*>].rotr(self, char[<*>] shift)macro ichar[<*>].popcount(self)macro ichar[<*>].ctz(self)macro ichar[<*>].clz(self)macro ichar[<*>] ichar[<*>].fshl(hi, ichar[<*>] lo, ichar[<*>] shift)macro ichar[<*>] ichar[<*>].fshr(hi, ichar[<*>] lo, ichar[<*>] shift)macro ichar[<*>] ichar[<*>].rotl(self, ichar[<*>] shift)macro ichar[<*>] ichar[<*>].rotr(self, ichar[<*>] shift)macro ulong[<*>].popcount(self)macro ulong[<*>].ctz(self)macro ulong[<*>].clz(self)macro ulong[<*>] ulong[<*>].fshl(hi, ulong[<*>] lo, ulong[<*>] shift)macro ulong[<*>] ulong[<*>].fshr(hi, ulong[<*>] lo, ulong[<*>] shift)macro ulong[<*>] ulong[<*>].rotl(self, ulong[<*>] shift)macro ulong[<*>] ulong[<*>].rotr(self, ulong[<*>] shift)macro long[<*>].popcount(self)macro long[<*>].ctz(self)macro long[<*>].clz(self)macro long[<*>] long[<*>].fshl(hi, long[<*>] lo, long[<*>] shift)macro long[<*>] long[<*>].fshr(hi, long[<*>] lo, long[<*>] shift)macro long[<*>] long[<*>].rotl(self, long[<*>] shift)macro long[<*>] long[<*>].rotr(self, long[<*>] shift)macro uint128[<*>].popcount(self)macro uint128[<*>].ctz(self)macro uint128[<*>].clz(self)macro uint128[<*>] uint128[<*>].fshl(hi, uint128[<*>] lo, uint128[<*>] shift)macro uint128[<*>] uint128[<*>].fshr(hi, uint128[<*>] lo, uint128[<*>] shift)macro uint128[<*>] uint128[<*>].rotl(self, uint128[<*>] shift)macro uint128[<*>] uint128[<*>].rotr(self, uint128[<*>] shift)macro int128[<*>].popcount(self)macro int128[<*>].ctz(self)macro int128[<*>].clz(self)macro int128[<*>] int128[<*>].fshl(hi, int128[<*>] lo, int128[<*>] shift)macro int128[<*>] int128[<*>].fshr(hi, int128[<*>] lo, int128[<*>] shift)macro int128[<*>] int128[<*>].rotl(self, int128[<*>] shift)macro int128[<*>] int128[<*>].rotr(self, int128[<*>] shift)macro uint.popcount(self)macro uint.ctz(self)macro uint.clz(self)macro uint uint.fshl(hi, uint lo, uint shift)macro uint uint.fshr(hi, uint lo, uint shift)macro uint uint.rotl(self, uint shift)macro uint uint.rotr(self, uint shift)macro int.popcount(self)macro int.ctz(self)macro int.clz(self)macro int int.fshl(hi, int lo, int shift)macro int int.fshr(hi, int lo, int shift)macro int int.rotl(self, int shift)macro int int.rotr(self, int shift)macro ushort.popcount(self)macro ushort.ctz(self)macro ushort.clz(self)macro ushort ushort.fshl(hi, ushort lo, ushort shift)macro ushort ushort.fshr(hi, ushort lo, ushort shift)macro ushort ushort.rotl(self, ushort shift)macro ushort ushort.rotr(self, ushort shift)macro short.popcount(self)macro short.ctz(self)macro short.clz(self)macro short short.fshl(hi, short lo, short shift)macro short short.fshr(hi, short lo, short shift)macro short short.rotl(self, short shift)macro short short.rotr(self, short shift)macro char.popcount(self)macro char.ctz(self)macro char.clz(self)macro char char.fshl(hi, char lo, char shift)macro char char.fshr(hi, char lo, char shift)macro char char.rotl(self, char shift)macro char char.rotr(self, char shift)macro ichar.popcount(self)macro ichar.ctz(self)macro ichar.clz(self)macro ichar ichar.fshl(hi, ichar lo, ichar shift)macro ichar ichar.fshr(hi, ichar lo, ichar shift)macro ichar ichar.rotl(self, ichar shift)macro ichar ichar.rotr(self, ichar shift)macro ulong.popcount(self)macro ulong.ctz(self)macro ulong.clz(self)macro ulong ulong.fshl(hi, ulong lo, ulong shift)macro ulong ulong.fshr(hi, ulong lo, ulong shift)macro ulong ulong.rotl(self, ulong shift)macro ulong ulong.rotr(self, ulong shift)macro long.popcount(self)macro long.ctz(self)macro long.clz(self)macro long long.fshl(hi, long lo, long shift)macro long long.fshr(hi, long lo, long shift)macro long long.rotl(self, long shift)macro long long.rotr(self, long shift)macro uint128.popcount(self)macro uint128.ctz(self)macro uint128.clz(self)macro uint128 uint128.fshl(hi, uint128 lo, uint128 shift)macro uint128 uint128.fshr(hi, uint128 lo, uint128 shift)macro uint128 uint128.rotl(self, uint128 shift)macro uint128 uint128.rotr(self, uint128 shift)macro int128.popcount(self)macro int128.ctz(self)macro int128.clz(self)macro int128 int128.fshl(hi, int128 lo, int128 shift)macro int128 int128.fshr(hi, int128 lo, int128 shift)macro int128 int128.rotl(self, int128 shift)macro int128 int128.rotr(self, int128 shift)std::collections::anylist
Section titled “std::collections::anylist”alias AnyPredicate = fn bool(any value)alias AnyTest = fn bool(any type, any context)struct AnyList (Printable)fn AnyList* AnyList.init(&self, Allocator allocator, usz initial_capacity = 16)fn AnyList* AnyList.tinit(&self, usz initial_capacity = 16)fn bool AnyList.is_initialized(&self) @inlinemacro void AnyList.push(&self, element)fn void AnyList.free_element(&self, any element) @inlinemacro AnyList.pop(&self, $Type)fn any? AnyList.copy_pop(&self, Allocator allocator)fn any? AnyList.tcopy_pop(&self)fn any? AnyList.pop_retained(&self)fn void AnyList.clear(&self)macro AnyList.pop_first(&self, $Type)fn any? AnyList.pop_first_retained(&self)fn any? AnyList.copy_pop_first(&self, Allocator allocator)fn any? AnyList.tcopy_pop_first(&self)fn void AnyList.remove_at(&self, usz index)fn void AnyList.add_all(&self, AnyList* other_list)fn void AnyList.reverse(&self)fn any[] AnyList.array_view(&self)macro void AnyList.push_front(&self, value)macro void AnyList.insert_at(&self, usz index, type)fn void AnyList.remove_last(&self)fn void AnyList.remove_first(&self)macro AnyList.first(&self, $Type)fn any? AnyList.first_any(&self) @inlinemacro AnyList.last(&self, $Type)fn any? AnyList.last_any(&self) @inlinefn bool AnyList.is_empty(&self) @inlinefn usz AnyList.len(&self) @operator(len) @inlinemacro AnyList.get(&self, usz index, $Type)fn any AnyList.get_any(&self, usz index) @inline @operator([])fn void AnyList.free(&self)fn void AnyList.swap(&self, usz i, usz j)fn usz? AnyList.to_format(&self, Formatter* formatter) @dynamicfn usz AnyList.remove_if(&self, AnyPredicate filter)fn usz AnyList.retain_if(&self, AnyPredicate selection)fn usz AnyList.remove_using_test(&self, AnyTest filter, any context)fn usz AnyList.retain_using_test(&self, AnyTest selection, any context)fn void AnyList.reserve(&self, usz min_capacity)macro void AnyList.set(&self, usz index, value)std::collections::bitset {SIZE}
Section titled “std::collections::bitset {SIZE}”struct BitSetfn usz BitSet.cardinality(&self)fn void BitSet.set(&self, usz i)macro BitSet BitSet.xor_self(&self, BitSet set) @operator(^=)fn BitSet BitSet.xor(&self, BitSet set) @operator(^)fn BitSet BitSet.or(&self, BitSet set) @operator(|)macro BitSet BitSet.or_self(&self, BitSet set) @operator(|=)fn BitSet BitSet.and(&self, BitSet set) @operator(&)macro BitSet BitSet.and_self(&self, BitSet set) @operator(&=)fn void BitSet.unset(&self, usz i)fn bool BitSet.get(&self, usz i) @operator([]) @inlinefn usz BitSet.len(&self) @operator(len) @inlinefn void BitSet.set_bool(&self, usz i, bool value) @operator([]=) @inlinestd::collections::elastic_array {Type, MAX_SIZE}
Section titled “std::collections::elastic_array {Type, MAX_SIZE}”alias ElementPredicate = fn bool(Type *type)alias ElementTest = fn bool(Type *type, any context)macro type_is_overaligned()struct ElasticArray (Printable)fn usz? ElasticArray.to_format(&self, Formatter* formatter) @dynamicfn String ElasticArray.to_tstring(&self)fn void? ElasticArray.push_try(&self, Type element) @inlinefn void ElasticArray.push(&self, Type element) @inlinefn Type? ElasticArray.pop(&self)fn void ElasticArray.clear(&self)fn Type? ElasticArray.pop_first(&self)fn void ElasticArray.remove_at(&self, usz index)fn void ElasticArray.add_all(&self, ElasticArray* other_list)fn usz ElasticArray.add_all_to_limit(&self, ElasticArray* other_list)fn usz ElasticArray.add_array_to_limit(&self, Type[] array)fn void ElasticArray.add_array(&self, Type[] array)fn Type[] ElasticArray.to_aligned_array(&self, Allocator allocator)macro Type[] ElasticArray.to_array(&self, Allocator allocator)fn Type[] ElasticArray.to_tarray(&self)fn void ElasticArray.reverse(&self)fn Type[] ElasticArray.array_view(&self)fn void ElasticArray.push_front(&self, Type type) @inlinefn void? ElasticArray.push_front_try(&self, Type type) @inlinefn void? ElasticArray.insert_at_try(&self, usz index, Type value)fn void ElasticArray.insert_at(&self, usz index, Type type)fn void ElasticArray.set_at(&self, usz index, Type type)fn void? ElasticArray.remove_last(&self) @maydiscardfn void? ElasticArray.remove_first(&self) @maydiscardfn Type? ElasticArray.first(&self)fn Type? ElasticArray.last(&self)fn bool ElasticArray.is_empty(&self) @inlinefn usz ElasticArray.byte_size(&self) @inlinefn usz ElasticArray.len(&self) @operator(len) @inlinefn Type ElasticArray.get(&self, usz index) @inlinefn void ElasticArray.swap(&self, usz i, usz j)fn usz ElasticArray.remove_if(&self, ElementPredicate filter)fn usz ElasticArray.retain_if(&self, ElementPredicate selection)fn usz ElasticArray.remove_using_test(&self, ElementTest filter, any context)fn usz ElasticArray.retain_using_test(&self, ElementTest filter, any context)macro Type ElasticArray.@item_at(&self, usz index) @operator([])fn Type* ElasticArray.get_ref(&self, usz index) @operator(&[]) @inlinefn void ElasticArray.set(&self, usz index, Type value) @operator([]=)fn usz? ElasticArray.index_of(&self, Type type) @if(ELEMENT_IS_EQUATABLE)fn usz? ElasticArray.rindex_of(&self, Type type) @if(ELEMENT_IS_EQUATABLE)fn bool ElasticArray.equals(&self, ElasticArray other_list) @if(ELEMENT_IS_EQUATABLE)fn bool ElasticArray.contains(&self, Type value) @if(ELEMENT_IS_EQUATABLE)fn bool ElasticArray.remove_last_item(&self, Type value) @if(ELEMENT_IS_EQUATABLE)fn bool ElasticArray.remove_first_item(&self, Type value) @if(ELEMENT_IS_EQUATABLE)fn usz ElasticArray.remove_item(&self, Type value) @if(ELEMENT_IS_EQUATABLE)fn void ElasticArray.remove_all_from(&self, ElasticArray* other_list) @if(ELEMENT_IS_EQUATABLE)fn usz ElasticArray.compact_count(&self) @if(ELEMENT_IS_POINTER)fn usz ElasticArray.compact(&self) @if(ELEMENT_IS_POINTER)std::collections::enummap{Enum, ValueType}
Section titled “std::collections::enummap{Enum, ValueType}”struct EnumMap (Printable)fn void EnumMap.init(&self, ValueType init_value)fn usz? EnumMap.to_format(&self, Formatter* formatter) @dynamicfn usz EnumMap.len(&self) @operator(len) @inlinefn ValueType EnumMap.get(&self, Enum key) @operator([]) @inlinefn ValueType* EnumMap.get_ref(&self, Enum key) @operator(&[]) @inlinefn void EnumMap.set(&self, Enum key, ValueType value) @operator([]=) @inlinestd::collections::enumset{Enum}
Section titled “std::collections::enumset{Enum}”typedef EnumSet (Printable) = EnumSetTypefn void EnumSet.add(&self, Enum v)fn void EnumSet.clear(&self)fn bool EnumSet.remove(&self, Enum v)fn bool EnumSet.has(&self, Enum v)fn void EnumSet.add_all(&self, EnumSet s)fn void EnumSet.retain_all(&self, EnumSet s)fn void EnumSet.remove_all(&self, EnumSet s)fn EnumSet EnumSet.and_of(&self, EnumSet s)fn EnumSet EnumSet.or_of(&self, EnumSet s)fn EnumSet EnumSet.diff_of(&self, EnumSet s)fn EnumSet EnumSet.xor_of(&self, EnumSet s)fn usz? EnumSet.to_format(&set, Formatter* formatter) @dynamicstd::collections::growablebitset{Type}
Section titled “std::collections::growablebitset{Type}”alias GrowableBitSetList = List{Type}struct GrowableBitSetfn GrowableBitSet* GrowableBitSet.init(&self, Allocator allocator, usz initial_capacity = 1)fn GrowableBitSet* GrowableBitSet.tinit(&self, usz initial_capacity = 1)fn void GrowableBitSet.free(&self)fn usz GrowableBitSet.cardinality(&self)fn void GrowableBitSet.set(&self, usz i)fn void GrowableBitSet.unset(&self, usz i)fn bool GrowableBitSet.get(&self, usz i) @operator([]) @inlinefn usz GrowableBitSet.len(&self) @operator(len)fn void GrowableBitSet.set_bool(&self, usz i, bool value) @operator([]=) @inlinestd::collections::linkedlist{Type}
Section titled “std::collections::linkedlist{Type}”struct LinkedListfn LinkedList* LinkedList.init(&self, Allocator allocator)fn LinkedList* LinkedList.tinit(&self)fn bool LinkedList.is_initialized(&self) @inlinefn void LinkedList.push_front(&self, Type value)fn void LinkedList.push(&self, Type value)fn Type? LinkedList.peek(&self)fn Type? LinkedList.peek_last(&self)fn Type? LinkedList.first(&self)fn Type? LinkedList.last(&self)fn void LinkedList.free(&self)fn void LinkedList.clear(&self)fn usz LinkedList.len(&self) @inlinemacro Node* LinkedList.node_at_index(&self, usz index)fn Type LinkedList.get(&self, usz index)fn void LinkedList.set(&self, usz index, Type element)fn void LinkedList.remove_at(&self, usz index)fn void LinkedList.insert_at(&self, usz index, Type element)fn usz LinkedList.remove(&self, Type t) @if(ELEMENT_IS_EQUATABLE)fn Type? LinkedList.pop(&self)fn bool LinkedList.is_empty(&self)fn Type? LinkedList.pop_front(&self)fn void? LinkedList.remove_last(&self) @maydiscardfn void? LinkedList.remove_first(&self) @maydiscardfn bool LinkedList.remove_first_match(&self, Type t) @if(ELEMENT_IS_EQUATABLE)fn bool LinkedList.remove_last_match(&self, Type t) @if(ELEMENT_IS_EQUATABLE)std::collections::list_common
Section titled “std::collections::list_common”macro list_to_aligned_array($Type, self, Allocator allocator)macro list_to_array($Type, self, Allocator allocator)macro void list_reverse(self)macro usz list_remove_using_test(self, filter, bool $invert, ctx)macro usz list_compact(self)macro usz list_remove_item(self, value)macro usz list_remove_if(self, filter, bool $invert)std::collections::list{Type}
Section titled “std::collections::list{Type}”alias ElementPredicate = fn bool(Type *type)alias ElementTest = fn bool(Type *type, any context)macro type_is_overaligned()struct List (Printable)fn List* List.init(&self, Allocator allocator, usz initial_capacity = 16)fn List* List.tinit(&self, usz initial_capacity = 16)fn List* List.init_with_array(&self, Allocator allocator, Type[] values)fn List* List.tinit_with_array(&self, Type[] values)fn void List.init_wrapping_array(&self, Allocator allocator, Type[] types)fn bool List.is_initialized(&self) @inlinefn usz? List.to_format(&self, Formatter* formatter) @dynamicfn void List.push(&self, Type element) @inlinefn Type? List.pop(&self)fn void List.clear(&self)fn Type? List.pop_first(&self)fn void List.remove_at(&self, usz index)fn void List.add_all(&self, List* other_list)fn Type[] List.to_aligned_array(&self, Allocator allocator)macro Type[] List.to_array(&self, Allocator allocator)fn Type[] List.to_tarray(&self)fn void List.reverse(&self)fn Type[] List.array_view(&self)fn void List.add_array(&self, Type[] array)fn void List.push_front(&self, Type type) @inlinefn void List.insert_at(&self, usz index, Type type)fn void List.set_at(&self, usz index, Type type)fn void? List.remove_last(&self) @maydiscardfn void? List.remove_first(&self) @maydiscardfn Type? List.first(&self)fn Type? List.last(&self)fn bool List.is_empty(&self) @inlinefn usz List.byte_size(&self) @inlinefn usz List.len(&self) @operator(len) @inlinefn Type List.get(&self, usz index) @inlinefn void List.free(&self)fn void List.swap(&self, usz i, usz j)fn usz List.remove_if(&self, ElementPredicate filter)fn usz List.retain_if(&self, ElementPredicate selection)fn usz List.remove_using_test(&self, ElementTest filter, any context)fn usz List.retain_using_test(&self, ElementTest filter, any context)macro Type List.@item_at(&self, usz index) @operator([])fn Type* List.get_ref(&self, usz index) @operator(&[]) @inlinefn void List.set(&self, usz index, Type value) @operator([]=)fn void List.reserve(&self, usz added)fn void List._update_size_change(&self,usz old_size, usz new_size)fn usz? List.index_of(&self, Type type) @if(ELEMENT_IS_EQUATABLE)fn usz? List.rindex_of(&self, Type type) @if(ELEMENT_IS_EQUATABLE)fn bool List.equals(&self, List other_list) @if(ELEMENT_IS_EQUATABLE)fn bool List.contains(&self, Type value) @if(ELEMENT_IS_EQUATABLE)fn bool List.remove_last_item(&self, Type value) @if(ELEMENT_IS_EQUATABLE)fn bool List.remove_first_item(&self, Type value) @if(ELEMENT_IS_EQUATABLE)fn usz List.remove_item(&self, Type value) @if(ELEMENT_IS_EQUATABLE)fn void List.remove_all_from(&self, List* other_list) @if(ELEMENT_IS_EQUATABLE)fn usz List.compact_count(&self) @if(ELEMENT_IS_POINTER)fn usz List.compact(&self) @if(ELEMENT_IS_POINTER)std::collections::map{Key, Value}
Section titled “std::collections::map{Key, Value}”struct Entrystruct HashMap (Printable)fn HashMap* HashMap.init(&self, Allocator allocator, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn HashMap* HashMap.tinit(&self, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)macro HashMap* HashMap.init_with_key_values(&self, Allocator allocator, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)macro HashMap* HashMap.tinit_with_key_values(&self, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn HashMap* HashMap.init_from_keys_and_values(&self, Allocator allocator, Key[] keys, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn HashMap* HashMap.tinit_from_keys_and_values(&self, Key[] keys, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn bool HashMap.is_initialized(&map)fn HashMap* HashMap.init_from_map(&self, Allocator allocator, HashMap* other_map)fn HashMap* HashMap.tinit_from_map(&map, HashMap* other_map)fn bool HashMap.is_empty(&map) @inlinefn usz HashMap.len(&map) @inlinefn Value*? HashMap.get_ref(&map, Key key)fn Entry*? HashMap.get_entry(&map, Key key)macro Value HashMap.@get_or_set(&map, Key key, Value #expr)fn Value? HashMap.get(&map, Key key) @operator([])fn bool HashMap.has_key(&map, Key key)fn bool HashMap.set(&map, Key key, Value value) @operator([]=)fn void? HashMap.remove(&map, Key key) @maydiscardfn void HashMap.clear(&map)fn void HashMap.free(&map)fn Key[] HashMap.tkeys(&self)fn Key[] HashMap.keys(&self, Allocator allocator)macro HashMap.@each(map; @body(key, value))macro HashMap.@each_entry(map; @body(entry))fn Value[] HashMap.tvalues(&map)fn Value[] HashMap.values(&self, Allocator allocator)fn bool HashMap.has_value(&map, Value v) @if(VALUE_IS_EQUATABLE)fn HashMapIterator HashMap.iter(&self)fn HashMapValueIterator HashMap.value_iter(&self)fn HashMapKeyIterator HashMap.key_iter(&self)fn usz? HashMap.to_format(&self, Formatter* f) @dynamicstruct HashMapIteratortypedef HashMapValueIterator = HashMapIteratortypedef HashMapKeyIterator = HashMapIteratorfn Entry HashMapIterator.get(&self, usz idx) @operator([])fn Value HashMapValueIterator.get(&self, usz idx) @operator([])fn Key HashMapKeyIterator.get(&self, usz idx) @operator([])fn usz HashMapValueIterator.len(self) @operator(len)fn usz HashMapKeyIterator.len(self) @operator(len)fn usz HashMapIterator.len(self) @operator(len)struct LinkedEntrystruct LinkedHashMap (Printable)fn LinkedHashMap* LinkedHashMap.init(&self, Allocator allocator, usz capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn LinkedHashMap* LinkedHashMap.tinit(&self, usz capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)macro LinkedHashMap* LinkedHashMap.init_with_key_values(&self, Allocator allocator, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)macro LinkedHashMap* LinkedHashMap.tinit_with_key_values(&self, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn LinkedHashMap* LinkedHashMap.init_from_keys_and_values(&self, Allocator allocator, Key[] keys, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn LinkedHashMap* LinkedHashMap.tinit_from_keys_and_values(&self, Key[] keys, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn bool LinkedHashMap.is_initialized(&map)fn LinkedHashMap* LinkedHashMap.init_from_map(&self, Allocator allocator, LinkedHashMap* other_map)fn LinkedHashMap* LinkedHashMap.tinit_from_map(&map, LinkedHashMap* other_map)fn bool LinkedHashMap.is_empty(&map) @inlinefn usz LinkedHashMap.len(&map) @inlinefn Value*? LinkedHashMap.get_ref(&map, Key key)fn LinkedEntry*? LinkedHashMap.get_entry(&map, Key key)macro Value LinkedHashMap.@get_or_set(&map, Key key, Value #expr)fn Value? LinkedHashMap.get(&map, Key key) @operator([])fn bool LinkedHashMap.has_key(&map, Key key)fn bool LinkedHashMap.set(&map, Key key, Value value) @operator([]=)fn void? LinkedHashMap.remove(&map, Key key) @maydiscardfn void LinkedHashMap.clear(&map)fn void LinkedHashMap.free(&map)fn Key[] LinkedHashMap.tkeys(&self)fn Key[] LinkedHashMap.keys(&self, Allocator allocator)macro LinkedHashMap.@each(map; @body(key, value))macro LinkedHashMap.@each_entry(map; @body(entry))fn Value[] LinkedHashMap.tvalues(&map)fn Value[] LinkedHashMap.values(&self, Allocator allocator)fn bool LinkedHashMap.has_value(&map, Value v) @if(VALUE_IS_EQUATABLE)fn LinkedHashMapIterator LinkedHashMap.iter(&self)fn LinkedHashMapValueIterator LinkedHashMap.value_iter(&self)fn LinkedHashMapKeyIterator LinkedHashMap.key_iter(&self)fn bool LinkedHashMapIterator.next(&self)fn LinkedEntry*? LinkedHashMapIterator.get(&self)fn Value*? LinkedHashMapValueIterator.get(&self)fn Key*? LinkedHashMapKeyIterator.get(&self)fn bool LinkedHashMapIterator.has_next(&self)fn usz? LinkedHashMap.to_format(&self, Formatter* f) @dynamicstruct LinkedHashMapIteratortypedef LinkedHashMapValueIterator = inline LinkedHashMapIteratortypedef LinkedHashMapKeyIterator = inline LinkedHashMapIteratorfn usz LinkedHashMapValueIterator.len(self) @operator(len)fn usz LinkedHashMapKeyIterator.len(self) @operator(len)fn usz LinkedHashMapIterator.len(self) @operator(len)std::collections::maybe{Type}
Section titled “std::collections::maybe{Type}”struct Maybe (Printable)fn usz? Maybe.to_format(&self, Formatter* f) @dynamicfn void Maybe.set(&self, Type val)fn void Maybe.reset(&self)fn Maybe value(Type val)macro Type? Maybe.get(self)fn bool Maybe.equals(self, Maybe other) @operator(==) @if(types::is_equatable_type(Type))std::collections::object
Section titled “std::collections::object”struct Object (Printable)fn usz? Object.to_format(&self, Formatter* formatter) @dynamicfn Object* new_obj(Allocator allocator)fn Object* new_null()fn Object* new_int(int128 i, Allocator allocator)macro Object* new_enum(e, Allocator allocator)fn Object* new_float(double f, Allocator allocator)fn Object* new_string(String s, Allocator allocator)fn Object* new_bool(bool b)fn void Object.free(&self)fn bool Object.is_null(&self) @inlinefn bool Object.is_empty(&self) @inlinefn bool Object.is_map(&self) @inlinefn bool Object.is_array(&self) @inlinefn bool Object.is_bool(&self) @inlinefn bool Object.is_string(&self) @inlinefn bool Object.is_float(&self) @inlinefn bool Object.is_int(&self) @inlinefn bool Object.is_keyable(&self)fn bool Object.is_indexable(&self)macro Object* Object.set(&self, String key, value)macro Object* Object.set_at(&self, usz index, String key, value)macro Object* Object.push(&self, value)fn Object*? Object.get(&self, String key)fn bool Object.has_key(&self, String key)fn Object* Object.get_at(&self, usz index)fn usz Object.get_len(&self)fn void Object.push_object(&self, Object* to_append)fn void Object.set_object_at(&self, usz index, Object* to_set)macro get_integer_value(Object* value, $Type)fn ichar? Object.get_ichar(&self, String key)fn short? Object.get_short(&self, String key)fn int? Object.get_int(&self, String key)fn long? Object.get_long(&self, String key)fn int128? Object.get_int128(&self, String key)fn ichar? Object.get_ichar_at(&self, usz index)fn short? Object.get_short_at(&self, usz index)fn int? Object.get_int_at(&self, usz index)fn long? Object.get_long_at(&self, usz index)fn int128? Object.get_int128_at(&self, usz index)fn char? Object.get_char(&self, String key)fn short? Object.get_ushort(&self, String key)fn uint? Object.get_uint(&self, String key)fn ulong? Object.get_ulong(&self, String key)fn uint128? Object.get_uint128(&self, String key)fn char? Object.get_char_at(&self, usz index)fn ushort? Object.get_ushort_at(&self, usz index)fn uint? Object.get_uint_at(&self, usz index)fn ulong? Object.get_ulong_at(&self, usz index)fn uint128? Object.get_uint128_at(&self, usz index)fn String? Object.get_string(&self, String key)fn String? Object.get_string_at(&self, usz index)macro String? Object.get_enum(&self, $EnumType, String key)macro String? Object.get_enum_at(&self, $EnumType, usz index)fn bool? Object.get_bool(&self, String key)fn bool? Object.get_bool_at(&self, usz index)fn double? Object.get_float(&self, String key)fn double? Object.get_float_at(&self, usz index)fn Object* Object.get_or_create_obj(&self, String key)std::collections::pair{Type1, Type2}
Section titled “std::collections::pair{Type1, Type2}”struct Pairmacro void Pair.unpack(&self, a, b)std::collections::priorityqueue::private{Type, MAX}
Section titled “std::collections::priorityqueue::private{Type, MAX}”struct PrivatePriorityQueue (Printable)fn PrivatePriorityQueue* PrivatePriorityQueue.init(&self, Allocator allocator, usz initial_capacity = 16, ) @inlinefn PrivatePriorityQueue* PrivatePriorityQueue.tinit(&self, usz initial_capacity = 16) @inlinefn void PrivatePriorityQueue.push(&self, Type element)fn void PrivatePriorityQueue.remove_at(&self, usz index)fn Type? PrivatePriorityQueue.pop(&self)fn Type? PrivatePriorityQueue.first(&self)fn void PrivatePriorityQueue.free(&self)fn usz PrivatePriorityQueue.len(&self) @operator(len)fn bool PrivatePriorityQueue.is_empty(&self)fn Type PrivatePriorityQueue.get(&self, usz index) @operator([])fn usz? PrivatePriorityQueue.to_format(&self, Formatter* formatter) @dynamicstd::collections::priorityqueue{Type}
Section titled “std::collections::priorityqueue{Type}”typedef PriorityQueue = inline PrivatePriorityQueue{Type, false}typedef PriorityQueueMax = inline PrivatePriorityQueue{Type, true}std::collections::range{Type}
Section titled “std::collections::range{Type}”struct Range (Printable)fn usz Range.len(&self) @operator(len)fn bool Range.contains(&self, Type value) @inlinefn Type Range.get(&self, usz index) @operator([])fn usz? Range.to_format(&self, Formatter* formatter) @dynamicstruct ExclusiveRange (Printable)fn usz ExclusiveRange.len(&self) @operator(len)fn bool ExclusiveRange.contains(&self, Type value) @inlinefn usz? ExclusiveRange.to_format(&self, Formatter* formatter) @dynamicfn Type ExclusiveRange.get(&self, usz index) @operator([])std::collections::ringbuffer{Type}
Section titled “std::collections::ringbuffer{Type}”alias Element = $typeof((Type){}[0])struct RingBuffer (Printable)fn void RingBuffer.init(&self) @inlinefn void RingBuffer.push(&self, Element c)fn Element RingBuffer.get(&self, usz index) @operator([])fn Element? RingBuffer.pop(&self)fn usz? RingBuffer.to_format(&self, Formatter* format) @dynamicfn usz RingBuffer.read(&self, usz index, Element[] buffer)fn void RingBuffer.write(&self, Element[] buffer)std::collections::set {Value}
Section titled “std::collections::set {Value}”struct Entrystruct HashSet (Printable)fn int HashSet.len(&self) @operator(len)fn HashSet* HashSet.init(&self, Allocator allocator, usz capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn HashSet* HashSet.tinit(&self, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)macro HashSet* HashSet.init_with_values(&self, Allocator allocator, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)macro HashSet* HashSet.tinit_with_values(&self, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn HashSet* HashSet.init_from_values(&self, Allocator allocator, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn HashSet* HashSet.tinit_from_values(&self, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn bool HashSet.is_initialized(&set)fn HashSet* HashSet.init_from_set(&self, Allocator allocator, HashSet* other_set)fn HashSet* HashSet.tinit_from_set(&set, HashSet* other_set)fn bool HashSet.is_empty(&set) @inlinefn usz HashSet.add_all(&set, Value[] list)fn usz HashSet.add_all_from(&set, HashSet* other)fn bool HashSet.add(&set, Value value)macro HashSet.@each(set; @body(value))fn bool HashSet.contains(&set, Value value)fn void? HashSet.remove(&set, Value value) @maydiscardfn usz HashSet.remove_all(&set, Value[] values)fn usz HashSet.remove_all_from(&set, HashSet* other)fn void HashSet.free(&set)fn void HashSet.clear(&set)fn void HashSet.reserve(&set, usz capacity)fn HashSet HashSet.set_union(&self, Allocator allocator, HashSet* other)fn HashSet HashSet.tset_union(&self, HashSet* other)fn HashSet HashSet.intersection(&self, Allocator allocator, HashSet* other)fn HashSet HashSet.tintersection(&self, HashSet* other)fn HashSet HashSet.difference(&self, Allocator allocator, HashSet* other)fn HashSet HashSet.tdifference(&self, HashSet* other)fn HashSet HashSet.symmetric_difference(&self, Allocator allocator, HashSet* other)fn HashSet HashSet.tsymmetric_difference(&self, HashSet* other)fn bool HashSet.is_subset(&self, HashSet* other)fn usz? HashSet.to_format(&self, Formatter* f) @dynamicstruct HashSetIteratorfn HashSetIterator HashSet.iter(&set)fn Value? HashSetIterator.next(&self)fn usz HashSetIterator.len(&self) @operator(len)struct LinkedEntrystruct LinkedHashSet (Printable)fn int LinkedHashSet.len(&self) @operator(len)fn LinkedHashSet* LinkedHashSet.init(&self, Allocator allocator, usz capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn LinkedHashSet* LinkedHashSet.tinit(&self, usz capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)macro LinkedHashSet* LinkedHashSet.init_with_values(&self, Allocator allocator, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)macro LinkedHashSet* LinkedHashSet.tinit_with_values(&self, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn LinkedHashSet* LinkedHashSet.init_from_values(&self, Allocator allocator, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn LinkedHashSet* LinkedHashSet.tinit_from_values(&self, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)fn bool LinkedHashSet.is_initialized(&set)fn LinkedHashSet* LinkedHashSet.init_from_set(&self, Allocator allocator, LinkedHashSet* other_set)fn LinkedHashSet* LinkedHashSet.tinit_from_set(&set, LinkedHashSet* other_set)fn bool LinkedHashSet.is_empty(&set) @inlinefn usz LinkedHashSet.add_all(&set, Value[] list)fn usz LinkedHashSet.add_all_from(&set, LinkedHashSet* other)fn bool LinkedHashSet.add(&set, Value value)macro LinkedHashSet.@each(set; @body(value))fn bool LinkedHashSet.contains(&set, Value value)fn void? LinkedHashSet.remove(&set, Value value) @maydiscardfn usz LinkedHashSet.remove_all(&set, Value[] values)fn usz LinkedHashSet.remove_all_from(&set, LinkedHashSet* other)fn void LinkedHashSet.free(&set)fn void LinkedHashSet.clear(&set)fn void LinkedHashSet.reserve(&set, usz capacity)fn LinkedHashSet LinkedHashSet.set_union(&self, Allocator allocator, LinkedHashSet* other)fn LinkedHashSet LinkedHashSet.tset_union(&self, LinkedHashSet* other)fn LinkedHashSet LinkedHashSet.intersection(&self, Allocator allocator, LinkedHashSet* other)fn LinkedHashSet LinkedHashSet.tintersection(&self, LinkedHashSet* other)fn LinkedHashSet LinkedHashSet.difference(&self, Allocator allocator, LinkedHashSet* other)fn LinkedHashSet LinkedHashSet.tdifference(&self, LinkedHashSet* other)fn LinkedHashSet LinkedHashSet.symmetric_difference(&self, Allocator allocator, LinkedHashSet* other)fn LinkedHashSet LinkedHashSet.tsymmetric_difference(&self, LinkedHashSet* other)fn bool LinkedHashSet.is_subset(&self, LinkedHashSet* other)fn usz? LinkedHashSet.to_format(&self, Formatter* f) @dynamicstruct LinkedHashSetIteratorfn LinkedHashSetIterator LinkedHashSet.iter(&set)fn bool LinkedHashSetIterator.next(&self)fn Value*? LinkedHashSetIterator.get(&self)fn bool LinkedHashSetIterator.has_next(&self)fn usz LinkedHashSetIterator.len(&self) @operator(len)std::collections::triple{Type1, Type2, Type3}
Section titled “std::collections::triple{Type1, Type2, Type3}”struct Triplemacro void Triple.unpack(&self, a, b, c)std::collections::tuple{Type1, Type2}
Section titled “std::collections::tuple{Type1, Type2}”struct Tuple @deprecated("Use 'Pair' instead")std::compression::qoi
Section titled “std::compression::qoi”enum QOIColorspace : char (char id)enum QOIChannels : char (char id)struct QOIDescfaultdef INVALID_PARAMETERS, FILE_OPEN_FAILED, FILE_WRITE_FAILED, INVALID_DATA, TOO_MANY_PIXELSfn char[]? encode(Allocator allocator, char[] input, QOIDesc* desc) @nodiscardfn char[]? decode(Allocator allocator, char[] data, QOIDesc* desc, QOIChannels channels = AUTO) @nodiscardstd::compression::qoi @if(!$feature(QOI_NO_STDIO))
Section titled “std::compression::qoi @if(!$feature(QOI_NO_STDIO))”fn usz? write(String filename, char[] input, QOIDesc* desc)fn char[]? read(Allocator allocator, String filename, QOIDesc* desc, QOIChannels channels = AUTO)std::core::array
Section titled “std::core::array”macro bool contains(array, element)macro index_of(array, element)macro slice2d(array_ptr, x = 0, xlen = 0, y = 0, ylen = 0)macro rindex_of(array, element)macro concat(Allocator allocator, arr1, arr2) @nodiscardmacro tconcat(arr1, arr2) @nodiscardstd::core::array::slice {Type}
Section titled “std::core::array::slice {Type}”struct Slice2dfn usz Slice2d.len(&self) @operator(len)fn usz Slice2d.count(&self)macro void Slice2d.@each(&self; @body(usz[<2>], Type))macro void Slice2d.@each_ref(&self; @body(usz[<2>], Type*))macro Type[] Slice2d.get_row(self, usz idy) @operator([])macro Type Slice2d.get_coord(self, usz[<2>] coord)macro Type* Slice2d.get_coord_ref(self, usz[<2>] coord)macro Type Slice2d.get_xy(self, x, y)macro Type* Slice2d.get_xy_ref(self, x, y)macro void Slice2d.set_coord(self, usz[<2>] coord, Type value)macro void Slice2d.set_xy(self, x, y, Type value)fn Slice2d Slice2d.slice(&self, isz x = 0, isz xlen = 0, isz y = 0, isz ylen = 0)std::core::ascii
Section titled “std::core::ascii”macro bool @is_lower(c)macro bool @is_upper(c)macro bool @is_digit(c)macro bool @is_bdigit(c)macro bool @is_odigit(c)macro bool @is_xdigit(c)macro bool @is_alpha(c)macro bool @is_print(c)macro bool @is_graph(c)macro bool @is_space(c)macro bool @is_alnum(c)macro bool @is_punct(c)macro bool @is_blank(c)macro bool @is_cntrl(c)macro char @to_lower(c)macro char @to_upper(c)fn bool is_lower(char c)fn bool is_upper(char c)fn bool is_digit(char c)fn bool is_bdigit(char c)fn bool is_odigit(char c)fn bool is_xdigit(char c)fn bool is_alpha(char c)fn bool is_print(char c)fn bool is_graph(char c)fn bool is_space(char c)fn bool is_alnum(char c)fn bool is_punct(char c)fn bool is_blank(char c)fn bool is_cntrl(char c)fn char to_lower(char c)fn char to_upper(char c)macro bool char.is_lower(char c)macro bool char.is_upper(char c)macro bool char.is_digit(char c)macro bool char.is_bdigit(char c)macro bool char.is_odigit(char c)macro bool char.is_xdigit(char c)macro bool char.is_alpha(char c)macro bool char.is_print(char c)macro bool char.is_graph(char c)macro bool char.is_space(char c)macro bool char.is_alnum(char c)macro bool char.is_punct(char c)macro bool char.is_blank(char c)macro bool char.is_cntrl(char c)macro char char.to_lower(char c)macro char char.to_upper(char c)macro char char.from_hex(char c)std::core::bitorder
Section titled “std::core::bitorder”bitstruct ShortBE : short @bigendianbitstruct UShortBE : ushort @bigendianbitstruct IntBE : int @bigendianbitstruct UIntBE : int @bigendianbitstruct LongBE : long @bigendianbitstruct ULongBE : ulong @bigendianbitstruct Int128BE : int128 @bigendianbitstruct UInt128BE : uint128 @bigendianbitstruct ShortLE : short @littleendianbitstruct UShortLE : ushort @littleendianbitstruct IntLE : int @littleendianbitstruct UIntLE : int @littleendianbitstruct LongLE : long @littleendianbitstruct ULongLE : ulong @littleendianbitstruct Int128LE : int128 @littleendianbitstruct UInt128LE : uint128 @littleendianmacro read(bytes, $Type)macro write(x, bytes, $Type)macro is_bitorder($Type)macro bool is_array_or_slice_of_char(bytes) @deprecated("Use @is_array_or_slice_of_char")macro bool @is_array_or_slice_of_char(#bytes) @constmacro bool is_arrayptr_or_slice_of_char(bytes) @deprecated("Use @is_arrayptr_or_slice_of_char")macro bool @is_arrayptr_or_slice_of_char(#bytes) @conststd::core::builtin
Section titled “std::core::builtin”typedef EmptySlot = void*macro @is_empty_macro_slot(#arg) @const @builtinmacro @is_valid_macro_slot(#arg) @const @builtinmacro @rnd() @const @builtinfaultdef NO_MORE_ELEMENT @builtinfaultdef NOT_FOUND @builtinfaultdef TYPE_MISMATCH @builtinalias VoidFn = fn void()macro void @scope(#variable; @body) @builtinmacro void @swap(#a, #b) @builtinmacro anycast(any v, $Type) @builtinmacro bool @assignable_to(#foo, $Type) @const @builtinmacro @addr(#val) @builtinmacro typeid @typeid(#value) @const @builtinmacro TypeKind @typekind(#value) @const @builtinmacro bool @typeis(#value, $Type) @const @builtinfn bool print_backtrace(String message, int backtraces_to_ignore) @iffn void default_panic(String message, String file, String function, uint line) @if(env::NATIVE_STACKTRACE)macro void abort(String string = "Unrecoverable error reached", ...) @format(0) @builtin @noreturnfn void default_panic(String message, String file, String function, uint line) @ifalias PanicFn = fn void(String message, String file, String function, uint line)fn void panicf(String fmt, String file, String function, uint line, args...)macro void unreachable(String string = "Unreachable statement reached.", ...) @builtin @noreturnmacro void unsupported(String string = "Unsupported function invoked") @builtin @noreturnmacro void breakpoint() @builtinmacro any_make(void* ptr, typeid type) @builtinmacro any.retype_to(&self, typeid type)macro any.as_inner(&self)macro bitcast(expr, $Type) @builtinmacro enum_by_name($Type, String enum_name) @builtinmacro @enum_from_value($Type, #value, value) @builtin @deprecated("Use Enum.lookup_field and Enum.lookup")macro bool @likely(bool #value, $probability = 1.0) @builtinmacro bool @unlikely(bool #value, $probability = 1.0) @builtinmacro @expect(#value, expected, $probability = 1.0) @builtinenum PrefetchLocalitymacro @prefetch(void* ptr, PrefetchLocality $locality = VERY_NEAR, bool $write = false) @builtinmacro swizzle(v, ...) @builtinmacro swizzle2(v, v2, ...) @builtinmacro fault @catch(#expr) @builtinmacro bool @ok(#expr) @builtinmacro void? @try(#v, #expr) @builtinmacro bool? @try_catch(#v, #expr, fault expected_fault) @builtinmacro char[] @as_char_view(#value) @builtinmacro isz @str_find(String $string, String $needle) @builtinmacro String @str_upper(String $str) @builtinmacro String @str_lower(String $str) @builtinmacro uint @str_hash(String $str) @builtinmacro @generic_hash_core(h, value)macro @generic_hash(value)macro uint int128.hash(self)macro uint uint128.hash(self)macro uint long.hash(self)macro uint ulong.hash(self)macro uint int.hash(self)macro uint uint.hash(self)macro uint short.hash(self)macro uint ushort.hash(self)macro uint ichar.hash(self)macro uint char.hash(self)macro uint bool.hash(self)macro uint int128[*].hash(&self)macro uint uint128[*].hash(&self)macro uint long[*].hash(&self)macro uint ulong[*].hash(&self)macro uint int[*].hash(&self)macro uint uint[*].hash(&self)macro uint short[*].hash(&self)macro uint ushort[*].hash(&self)macro uint char[*].hash(&self)macro uint ichar[*].hash(&self)macro uint bool[*].hash(&self)macro uint int128[<*>].hash(self)macro uint uint128[<*>].hash(self)macro uint long[<*>].hash(self)macro uint ulong[<*>].hash(self)macro uint int[<*>].hash(self)macro uint uint[<*>].hash(self)macro uint short[<*>].hash(self)macro uint ushort[<*>].hash(self)macro uint char[<*>].hash(self)macro uint ichar[<*>].hash(self)macro uint bool[<*>].hash(self)macro uint typeid.hash(typeid t)macro uint String.hash(String c)macro uint char[].hash(char[] c)macro uint void*.hash(void* ptr)macro void* get_frameaddress(int n)macro void* get_returnaddress(int n)macro less(a, b) @builtinmacro less_eq(a, b) @builtinmacro greater(a, b) @builtinmacro int compare_to(a, b) @builtinmacro greater_eq(a, b) @builtinmacro bool equals(a, b) @builtinmacro min(x, ...) @builtinmacro max(x, ...) @builtinstd::core::builtin @if((env::LINUX || env::ANDROID || env::DARWIN) && env::COMPILER_SAFE_MODE && env::DEBUG_SYMBOLS)
Section titled “std::core::builtin @if((env::LINUX || env::ANDROID || env::DARWIN) && env::COMPILER_SAFE_MODE && env::DEBUG_SYMBOLS)”fn void sig_panic(String message)fn void sig_bus_error(CInt i)fn void sig_segmentation_fault(CInt i)std::core::cinterop
Section titled “std::core::cinterop”alias CShort = $typefrom(signed_int_from_bitsize($$C_SHORT_SIZE))alias CUShort = $typefrom(unsigned_int_from_bitsize($$C_SHORT_SIZE))alias CInt = $typefrom(signed_int_from_bitsize($$C_INT_SIZE))alias CUInt = $typefrom(unsigned_int_from_bitsize($$C_INT_SIZE))alias CLong = $typefrom(signed_int_from_bitsize($$C_LONG_SIZE))alias CULong = $typefrom(unsigned_int_from_bitsize($$C_LONG_SIZE))alias CLongLong = $typefrom(signed_int_from_bitsize($$C_LONG_LONG_SIZE))alias CULongLong = $typefrom(unsigned_int_from_bitsize($$C_LONG_LONG_SIZE))alias CSChar = icharalias CUChar = charalias CChar = $typefrom($$C_CHAR_IS_SIGNED ? ichar.typeid : char.typeid)enum CBool : charstd::core::cpudetect @if(env::X86 || env::X86_64)
Section titled “std::core::cpudetect @if(env::X86 || env::X86_64)”struct CpuIdfn CpuId x86_cpuid(uint eax, uint ecx = 0)enum X86Featurefn void add_feature_if_bit(X86Feature feature, uint register, int bit)fn void x86_initialize_cpu_features()std::core::dstring
Section titled “std::core::dstring”typedef DString (OutStream) = DStringOpaque*typedef DStringOpaque = voidfn DString DString.init(&self, Allocator allocator, usz capacity = MIN_CAPACITY)fn DString DString.tinit(&self, usz capacity = MIN_CAPACITY)fn DString new_with_capacity(Allocator allocator, usz capacity)fn DString temp_with_capacity(usz capacity)fn DString new(Allocator allocator, String c = "")fn DString temp(String s = "")fn void DString.replace_char(self, char ch, char replacement)fn void DString.replace(&self, String needle, String replacement)fn DString DString.concat(self, Allocator allocator, DString b) @nodiscardfn DString DString.tconcat(self, DString b)fn ZString DString.zstr_view(&self)fn usz DString.capacity(self)fn usz DString.len(&self) @dynamic @operator(len)fn void DString.chop(self, usz new_size)fn String DString.str_view(self)fn char DString.char_at(self, usz index) @operator([])fn char* DString.char_ref(&self, usz index) @operator(&[])fn usz DString.append_utf32(&self, Char32[] chars)fn void DString.set(self, usz index, char c) @operator([]=)fn void DString.append_repeat(&self, char c, usz times)fn usz DString.append_char32(&self, Char32 c)fn DString DString.tcopy(&self)fn DString DString.copy(self, Allocator allocator) @nodiscardfn ZString DString.copy_zstr(self, Allocator allocator) @nodiscardfn String DString.copy_str(self, Allocator allocator) @nodiscardfn String DString.tcopy_str(self) @nodiscardfn bool DString.equals(self, DString other_string)fn void DString.free(&self)fn bool DString.less(self, DString other_string)fn void DString.append_chars(&self, String str)fn Char32[] DString.copy_utf32(&self, Allocator allocator)fn void DString.append_string(&self, DString str)fn void DString.clear(self)fn usz? DString.write(&self, char[] buffer) @dynamicfn void? DString.write_byte(&self, char c) @dynamicfn void DString.append_char(&self, char c)fn void DString.delete_range(&self, usz start, usz end)fn void DString.delete(&self, usz start, usz len = 1)macro void DString.append(&self, value)fn void DString.insert_chars_at(&self, usz index, String s)fn void DString.insert_string_at(&self, usz index, DString str)fn void DString.insert_char_at(&self, usz index, char c)fn usz DString.insert_char32_at(&self, usz index, Char32 c)fn usz DString.insert_utf32_at(&self, usz index, Char32[] chars)macro void DString.insert_at(&self, usz index, value)fn usz? DString.appendf(&self, String format, args...) @maydiscardfn usz? DString.appendfn(&self, String format, args...) @maydiscardfn DString join(Allocator allocator, String[] s, String joiner) @nodiscardfn void DString.reverse(self)fn void DString.reserve(&self, usz addition)fn usz? DString.read_from_stream(&self, InStream reader)std::core::env
Section titled “std::core::env”enum CompilerOptLevelenum MemoryEnvironmentenum OsTypeenum ArchTypemacro bool os_is_darwin() @constmacro bool os_is_posix() @conststd::core::main_stub
Section titled “std::core::main_stub”macro int @main_to_err_main(#m, int, char**)macro int @main_to_int_main(#m, int, char**)macro int @main_to_void_main(#m, int, char**)macro int @main_to_err_main_args(#m, int argc, char** argv)macro int @main_to_int_main_args(#m, int argc, char** argv)macro int @_main_runner(#m, int argc, char** argv)macro int @main_to_void_main_args(#m, int argc, char** argv)std::core::main_stub @if(env::WIN32)
Section titled “std::core::main_stub @if(env::WIN32)”extern fn Char16** _win_command_line_to_argv_w(ushort* cmd_line, int* argc_ptr) @extern("CommandLineToArgvW")macro int @win_to_err_main_noargs(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)macro int @win_to_int_main_noargs(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)macro int @win_to_void_main_noargs(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)macro int @win_to_err_main_args(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)macro int @win_to_int_main_args(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)macro int @win_to_void_main_args(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)macro int @win_to_err_main(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)macro int @win_to_int_main(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)macro int @win_to_void_main(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)macro int @wmain_to_err_main_args(#m, int argc, Char16** argv)macro int @wmain_to_int_main_args(#m, int argc, Char16** argv)macro int @_wmain_runner(#m, int argc, Char16** argv)macro int @wmain_to_void_main_args(#m, int argc, Char16** argv)std::core::mem
Section titled “std::core::mem”faultdef OUT_OF_MEMORY, INVALID_ALLOC_SIZEfn usz os_pagesize()macro masked_load(ptr, bool[<*>] mask, passthru)macro @masked_load_aligned(ptr, bool[<*>] mask, passthru, usz $alignment)macro gather(ptrvec, bool[<*>] mask, passthru)macro @gather_aligned(ptrvec, bool[<*>] mask, passthru, usz $alignment)macro masked_store(ptr, value, bool[<*>] mask)macro @masked_store_aligned(ptr, value, bool[<*>] mask, usz $alignment)macro scatter(ptrvec, value, bool[<*>] mask)macro @scatter_aligned(ptrvec, value, bool[<*>] mask, usz $alignment)macro @unaligned_load(#x, usz $alignment) @builtinmacro @unaligned_store(#x, value, usz $alignment) @builtinmacro @volatile_load(#x) @builtinmacro @volatile_store(#x, value) @builtinenum AtomicOrdering : intmacro @atomic_load(#x, AtomicOrdering $ordering = SEQ_CONSISTENT, $volatile = false) @builtinmacro void @atomic_store(#x, value, AtomicOrdering $ordering = SEQ_CONSISTENT, $volatile = false) @builtinmacro compare_exchange(ptr, compare, value, AtomicOrdering $success = SEQ_CONSISTENT, AtomicOrdering $failure = SEQ_CONSISTENT, bool $volatile = true, bool $weak = false, usz $alignment = 0)macro compare_exchange_volatile(ptr, compare, value, AtomicOrdering $success = SEQ_CONSISTENT, AtomicOrdering $failure = SEQ_CONSISTENT)fn usz aligned_offset(usz offset, usz alignment)macro void* aligned_pointer(void* ptr, usz alignment)fn bool ptr_is_aligned(void* ptr, usz alignment) @inlinefn bool ptr_is_page_aligned(void* ptr) @inlinemacro void zero_volatile(char[] data)macro void clear(void* dst, usz len, usz $dst_align = 0, bool $is_volatile = false)macro void clear_inline(void* dst, usz $len, usz $dst_align = 0, bool $is_volatile = false)macro void copy(void* dst, void* src, usz len, usz $dst_align = 0, usz $src_align = 0, bool $is_volatile = false)macro void copy_inline(void* dst, void* src, usz $len, usz $dst_align = 0, usz $src_align = 0, bool $is_volatile = false)macro void move(void* dst, void* src, usz len, usz $dst_align = 0, usz $src_align = 0, bool $is_volatile = false)macro void set(void* dst, char val, usz len, usz $dst_align = 0, bool $is_volatile = false)macro void set_inline(void* dst, char val, usz $len, usz $dst_align = 0, bool $is_volatile = false)macro bool equals(a, b, isz len = -1, usz $align = 0)macro bool type_alloc_must_be_aligned($Type)macro void @scoped(Allocator allocator; @body())macro void @report_heap_allocs_in_scope($enabled = true; @body())macro void @assert_leak($report = true; @body()) @builtinmacro void @stack_mem(usz $size; @body(Allocator mem)) @builtinmacro void @stack_pool(usz $size; @body) @builtinfn PoolState temp_push()fn void temp_pop(PoolState old_state)macro void @pool_init(Allocator allocator, usz pool_size, usz reserve_size = allocator::temp_allocator_reserve_size, usz min_size = allocator::temp_allocator_min_size, usz realloc_size = allocator::temp_allocator_realloc_size; @body) @builtinmacro void @pool(usz reserve = 0; @body) @builtinmacro TrackingEnv* get_tracking_env()macro @clone(value) @builtin @nodiscardmacro @clone_aligned(value) @builtin @nodiscardmacro @tclone(value) @builtin @nodiscardfn void* malloc(usz size) @builtin @inline @nodiscardfn void* malloc_aligned(usz size, usz alignment) @builtin @inline @nodiscardfn void* tmalloc(usz size, usz alignment = 0) @builtin @inline @nodiscardmacro new($Type, ...) @nodiscardmacro new_with_padding($Type, usz padding, ...) @nodiscardmacro new_aligned($Type, ...) @nodiscardmacro alloc($Type) @nodiscardmacro alloc_with_padding($Type, usz padding) @nodiscardmacro alloc_aligned($Type) @nodiscardmacro tnew($Type, ...) @nodiscardmacro temp_with_padding($Type, usz padding, ...) @nodiscardmacro talloc($Type) @nodiscardmacro talloc_with_padding($Type, usz padding) @nodiscardmacro new_array($Type, usz elements) @nodiscardmacro new_array_aligned($Type, usz elements) @nodiscardmacro alloc_array($Type, usz elements) @nodiscardmacro alloc_array_aligned($Type, usz elements) @nodiscardmacro talloc_array($Type, usz elements) @nodiscardmacro temp_array($Type, usz elements) @nodiscardfn void* calloc(usz size) @builtin @inline @nodiscardfn void* calloc_aligned(usz size, usz alignment) @builtin @inline @nodiscardfn void* tcalloc(usz size, usz alignment = 0) @builtin @inline @nodiscardfn void* realloc(void *ptr, usz new_size) @builtin @inline @nodiscardfn void* realloc_aligned(void *ptr, usz new_size, usz alignment) @builtin @inline @nodiscardfn void free(void* ptr) @builtin @inlinefn void free_aligned(void* ptr) @builtin @inlinefn void* trealloc(void* ptr, usz size, usz alignment = mem::DEFAULT_MEM_ALIGNMENT) @builtin @inline @nodiscardmacro @unaligned_addr(#arg) @builtinstd::core::mem @if(WASM_NOLIBC)
Section titled “std::core::mem @if(WASM_NOLIBC)”std::core::mem @if(env::NO_LIBC)
Section titled “std::core::mem @if(env::NO_LIBC)”fn CInt __memcmp(void* s1, void* s2, usz n) @weak @export("memcmp")fn void* __memset(void* str, CInt c, usz n) @weak @export("memset")fn void* __memcpy(void* dst, void* src, usz n) @weak @export("memcpy")std::core::mem::alignment { Type, ALIGNMENT }
Section titled “std::core::mem::alignment { Type, ALIGNMENT }”typedef UnalignedRef = Type*macro Type UnalignedRef.get(self)macro Type UnalignedRef.set(&self, Type val)std::core::mem::allocator
Section titled “std::core::mem::allocator”struct ArenaAllocator (Allocator)fn ArenaAllocator* ArenaAllocator.init(&self, char[] data)fn void ArenaAllocator.clear(&self)macro ArenaAllocator* wrap(char[] bytes)fn usz ArenaAllocator.mark(&self)fn void ArenaAllocator.reset(&self, usz mark)fn void ArenaAllocator.release(&self, void* ptr, bool) @dynamicfn void*? ArenaAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamicfn void*? ArenaAllocator.resize(&self, void *old_pointer, usz size, usz alignment) @dynamicstruct BackedArenaAllocator (Allocator)macro usz ExtraPage.pagesize(&self)macro bool ExtraPage.is_aligned(&self)fn BackedArenaAllocator*? new_backed_allocator(usz size, Allocator allocator)fn void BackedArenaAllocator.destroy(&self)fn usz BackedArenaAllocator.mark(&self)fn void BackedArenaAllocator.release(&self, void* old_pointer, bool) @dynamicfn void BackedArenaAllocator.reset(&self, usz mark)fn void*? BackedArenaAllocator.resize(&self, void* pointer, usz size, usz alignment) @dynamicfn void*? BackedArenaAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamicstruct DynamicArenaAllocator (Allocator)fn void DynamicArenaAllocator.init(&self, Allocator allocator, usz page_size)fn void DynamicArenaAllocator.free(&self)fn void DynamicArenaAllocator.release(&self, void* ptr, bool) @dynamicfn void*? DynamicArenaAllocator.resize(&self, void* old_pointer, usz size, usz alignment) @dynamicfn void DynamicArenaAllocator.reset(&self)fn void*? DynamicArenaAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamicstruct SimpleHeapAllocator (Allocator)fn void SimpleHeapAllocator.init(&self, MemoryAllocFn allocator)fn void*? SimpleHeapAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamicfn void*? SimpleHeapAllocator.resize(&self, void* old_pointer, usz size, usz alignment) @dynamicfn void SimpleHeapAllocator.release(&self, void* old_pointer, bool aligned) @dynamicstruct OnStackAllocator (Allocator)fn void OnStackAllocator.init(&self, char[] data, Allocator allocator)fn void OnStackAllocator.free(&self)struct OnStackAllocatorHeaderfn void OnStackAllocator.release(&self, void* old_pointer, bool aligned) @dynamicfn void*? OnStackAllocator.resize(&self, void* old_pointer, usz size, usz alignment) @dynamicfn void*? OnStackAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamicstruct Allocationalias AllocMap = HashMap { uptr, Allocation }struct TrackingAllocator (Allocator)fn void TrackingAllocator.init(&self, Allocator allocator)fn void TrackingAllocator.free(&self)fn usz TrackingAllocator.allocated(&self)fn usz TrackingAllocator.total_allocated(&self)fn usz TrackingAllocator.total_allocation_count(&self)fn Allocation[] TrackingAllocator.allocations_tlist(&self, Allocator allocator)fn usz TrackingAllocator.allocation_count(&self)fn void*? TrackingAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamicfn void*? TrackingAllocator.resize(&self, void* old_pointer, usz size, usz alignment) @dynamicfn void TrackingAllocator.release(&self, void* old_pointer, bool is_aligned) @dynamicfn void TrackingAllocator.clear(&self)fn bool TrackingAllocator.has_leaks(&self)fn void TrackingAllocator.print_report(&self)fn void? TrackingAllocator.fprint_report(&self, OutStream out)struct TrackingEnvenum AllocInitTypealias MemoryAllocFn = fn char[]?(usz)macro void* malloc(Allocator allocator, usz size) @nodiscardmacro void*? malloc_try(Allocator allocator, usz size) @nodiscardmacro void* calloc(Allocator allocator, usz size) @nodiscardmacro void*? calloc_try(Allocator allocator, usz size) @nodiscardmacro void* realloc(Allocator allocator, void* ptr, usz new_size) @nodiscardmacro void*? realloc_try(Allocator allocator, void* ptr, usz new_size) @nodiscardmacro void free(Allocator allocator, void* ptr)macro void*? malloc_aligned(Allocator allocator, usz size, usz alignment) @nodiscardmacro void*? calloc_aligned(Allocator allocator, usz size, usz alignment) @nodiscardmacro void*? realloc_aligned(Allocator allocator, void* ptr, usz new_size, usz alignment) @nodiscardmacro void free_aligned(Allocator allocator, void* ptr)macro new(Allocator allocator, $Type, ...) @nodiscardmacro new_try(Allocator allocator, $Type, ...) @nodiscardmacro new_aligned(Allocator allocator, $Type, ...) @nodiscardmacro new_with_padding(Allocator allocator, $Type, usz padding) @nodiscardmacro alloc(Allocator allocator, $Type) @nodiscardmacro alloc_try(Allocator allocator, $Type) @nodiscardmacro alloc_aligned(Allocator allocator, $Type) @nodiscardmacro alloc_with_padding(Allocator allocator, $Type, usz padding) @nodiscardmacro new_array(Allocator allocator, $Type, usz elements) @nodiscardmacro new_array_try(Allocator allocator, $Type, usz elements) @nodiscardmacro new_array_aligned(Allocator allocator, $Type, usz elements) @nodiscardmacro alloc_array(Allocator allocator, $Type, usz elements) @nodiscardmacro alloc_array_aligned(Allocator allocator, $Type, usz elements) @nodiscardmacro alloc_array_try(Allocator allocator, $Type, usz elements) @nodiscardmacro clone(Allocator allocator, value) @nodiscardmacro clone_aligned(Allocator allocator, value) @nodiscardfn any clone_any(Allocator allocator, any value) @nodiscardmacro void*? @aligned_alloc(#alloc_fn, usz bytes, usz alignment)struct AlignedBlockmacro void? @aligned_free(#free_fn, void* old_pointer)macro void*? @aligned_realloc(#calloc_fn, #free_fn, void* old_pointer, usz bytes, usz alignment)alias mem @builtin = thread_allocatortypedef PoolState = TempAllocator*fn PoolState push_pool(usz reserve = 0)fn void pop_pool(PoolState old)macro Allocator heap() @deprecated("Use 'mem' instead.")macro Allocator temp() @deprecated("Use 'tmem' instead")alias tmem @builtin = current_tempfn void destroy_temp_allocators()fn void*? LazyTempAllocator.acquire(&self, usz bytes, AllocInitType init_type, usz alignment) @dynamicfn void*? LazyTempAllocator.resize(&self, void* old_ptr, usz new_bytes, usz alignment) @dynamicfn void LazyTempAllocator.release(&self, void* old_ptr, bool aligned) @dynamictypedef NullAllocator (Allocator) = uptrfn void*? NullAllocator.acquire(&self, usz bytes, AllocInitType init_type, usz alignment) @dynamicfn void*? NullAllocator.resize(&self, void* old_ptr, usz new_bytes, usz alignment) @dynamicfn void NullAllocator.release(&self, void* old_ptr, bool aligned) @dynamicstruct WasmMemoryfn char[]? WasmMemory.allocate_block(&self, usz bytes)std::core::mem::allocator @if(!(env::POSIX || env::WIN32) || !$feature(VMEM_TEMP))
Section titled “std::core::mem::allocator @if(!(env::POSIX || env::WIN32) || !$feature(VMEM_TEMP))”struct TempAllocator (Allocator)struct TempAllocatorPagemacro usz TempAllocatorPage.pagesize(&self)macro bool TempAllocatorPage.is_aligned(&self)fn TempAllocator*? new_temp_allocator(Allocator allocator, usz size, usz reserve = temp_allocator_reserve_size, usz min_size = temp_allocator_min_size, usz realloc_size = temp_allocator_realloc_size)fn TempAllocator*? TempAllocator.derive_allocator(&self, usz reserve = 0)fn void TempAllocator.reset(&self)fn void TempAllocator.free(&self)fn void TempAllocator.release(&self, void* old_pointer, bool) @dynamicfn void*? TempAllocator.resize(&self, void* pointer, usz size, usz alignment) @dynamicfn void*? TempAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamicstd::core::mem::allocator @if(!env::WIN32 && !env::POSIX && env::LIBC)
Section titled “std::core::mem::allocator @if(!env::WIN32 && !env::POSIX && env::LIBC)”fn void*? LibcAllocator.acquire(&self, usz bytes, AllocInitType init_type, usz alignment) @dynamicfn void*? LibcAllocator.resize(&self, void* old_ptr, usz new_bytes, usz alignment) @dynamicfn void LibcAllocator.release(&self, void* old_ptr, bool aligned) @dynamicstd::core::mem::allocator @if((env::POSIX || env::WIN32) && $feature(VMEM_TEMP))
Section titled “std::core::mem::allocator @if((env::POSIX || env::WIN32) && $feature(VMEM_TEMP))”fn TempAllocator*? new_temp_allocator(Allocator allocator, usz size, usz reserve = temp_allocator_reserve_size, usz min_size = temp_allocator_min_size, usz realloc_size = temp_allocator_realloc_size)struct TempAllocator (Allocator)fn void*? TempAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamicfn TempAllocator*? TempAllocator.derive_allocator(&self, usz reserve = 0)fn void TempAllocator.reset(&self)fn void TempAllocator.free(&self)fn void*? TempAllocator.resize(&self, void* pointer, usz size, usz alignment) @dynamicfn void TempAllocator.release(&self, void* old_pointer, bool b) @dynamicstd::core::mem::allocator @if(env::LIBC)
Section titled “std::core::mem::allocator @if(env::LIBC)”typedef LibcAllocator (Allocator) = uptrstd::core::mem::allocator @if(env::POSIX || env::WIN32)
Section titled “std::core::mem::allocator @if(env::POSIX || env::WIN32)”faultdef VMEM_RESERVE_FAILEDstruct Vmem (Allocator)bitstruct VmemOptions : intfn void? Vmem.init(&self, usz preferred_size, usz reserve_page_size = 0, VmemOptions options = { true, true, env::COMPILER_SAFE_MODE }, usz min_size = 0)fn void*? Vmem.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamicfn bool Vmem.owns_pointer(&self, void* ptr) @inlinefn void*? Vmem.resize(&self, void *old_pointer, usz size, usz alignment) @dynamicfn void Vmem.release(&self, void* ptr, bool) @dynamicfn usz Vmem.mark(&self)fn void Vmem.reset(&self, usz mark)fn void Vmem.free(&self)std::core::mem::allocator @if(env::POSIX)
Section titled “std::core::mem::allocator @if(env::POSIX)”fn void*? LibcAllocator.acquire(&self, usz bytes, AllocInitType init_type, usz alignment) @dynamicfn void*? LibcAllocator.resize(&self, void* old_ptr, usz new_bytes, usz alignment) @dynamicfn void LibcAllocator.release(&self, void* old_ptr, bool aligned) @dynamicstd::core::mem::allocator @if(env::WIN32)
Section titled “std::core::mem::allocator @if(env::WIN32)”fn void*? LibcAllocator.acquire(&self, usz bytes, AllocInitType init_type, usz alignment) @dynamicfn void*? LibcAllocator.resize(&self, void* old_ptr, usz new_bytes, usz alignment) @dynamicfn void LibcAllocator.release(&self, void* old_ptr, bool aligned) @dynamicstd::core::mem::rc
Section titled “std::core::mem::rc”struct RefCountedmacro retain(refcounted)macro void release(refcounted)std::core::mem::ref { Type }
Section titled “std::core::mem::ref { Type }”alias DeallocFn = fn void(void*)fn Ref wrap(Type* ptr, Allocator allocator = mem)macro Ref new(..., Allocator allocator = mem)struct Reffn Ref* Ref.retain(&self)fn void Ref.release(&self)std::core::mem::vm
Section titled “std::core::mem::vm”struct VirtualMemoryfaultdef RANGE_OVERFLOW, UNKNOWN_ERROR, ACCESS_DENIED, UNMAPPED_ACCESS, UNALIGNED_ADDRESS, RELEASE_FAILED, UPDATE_FAILED, INVALID_ARGSenum VirtualMemoryAccessfn usz aligned_alloc_size(usz size)fn void*? alloc(usz size, VirtualMemoryAccess access)fn void? release(void* ptr, usz size)fn void? protect(void* ptr, usz len, VirtualMemoryAccess access)fn void? commit(void* ptr, usz len, VirtualMemoryAccess access = READWRITE)fn void? decommit(void* ptr, usz len, bool block = true)fn VirtualMemory? virtual_alloc(usz size, VirtualMemoryAccess access = PROTECTED)macro void? VirtualMemory.commit(self, usz offset, usz len)macro void? VirtualMemory.protect(self, usz offset, usz len, VirtualMemoryAccess access)fn void? VirtualMemory.decommit(self, usz offset, usz len, bool block = true)fn void? VirtualMemory.destroy(&self)std::core::mem::volatile { Type }
Section titled “std::core::mem::volatile { Type }”typedef Volatile @structlike = Typemacro Type Volatile.get(&self)macro Type Volatile.set(&self, Type val)std::core::runtime
Section titled “std::core::runtime”struct ReflectedParam (Printable) @if(!$defined(ReflectedParam))struct AnyRawstruct SliceRawmacro @enum_lookup($Type, #value, value)macro @enum_lookup_new($Type, $name, value)alias BenchmarkFn = fn void()struct BenchmarkUnitfn BenchmarkUnit[] benchmark_collection_create(Allocator allocator)fn void set_benchmark_warmup_iterations(uint value) @builtinfn void set_benchmark_max_iterations(uint value) @builtinfn bool run_benchmarks(BenchmarkUnit[] benchmarks)fn bool default_benchmark_runner(String[] args)alias TestFn = fn void()struct TestContextstruct TestUnitfn TestUnit[] test_collection_create(Allocator allocator)fn int cmp_test_unit(TestUnit a, TestUnit b)fn bool default_test_runner(String[] args)std::core::runtime @if(WASM_NOLIBC)
Section titled “std::core::runtime @if(WASM_NOLIBC)”extern fn void __wasm_call_ctors()std::core::sanitizer
Section titled “std::core::sanitizer”macro void annotate_contiguous_container(void* beg, void* end, void* old_mid, void* new_mid)macro void annotate_double_ended_contiguous_container(void* storage_beg, void* storage_end, void* old_container_beg, void* old_container_end, void* new_container_beg, void* new_container_end)macro void print_stack_trace()fn void set_death_callback(VoidFn callback)std::core::sanitizer @if (env::ANY_SANITIZER)
Section titled “std::core::sanitizer @if (env::ANY_SANITIZER)”struct __Sanitizer_sandbox_argumentsextern fn void __sanitizer_set_report_path(ZString path)std::core::sanitizer::asan
Section titled “std::core::sanitizer::asan”alias ErrorCallback = fn void (ZString)macro poison_memory_region(void* addr, usz size)macro unpoison_memory_region(void* addr, usz size)macro bool address_is_poisoned(void* addr)macro void* region_is_poisoned(void* beg, usz size)fn void set_error_report_callback(ErrorCallback callback)std::core::sanitizer::asan @if(env::ADDRESS_SANITIZER)
Section titled “std::core::sanitizer::asan @if(env::ADDRESS_SANITIZER)”extern fn void __asan_poison_memory_region(void* addr, usz size)std::core::sanitizer::tsan
Section titled “std::core::sanitizer::tsan”typedef MutexFlags = inline CUIntmacro void mutex_create(void* addr, MutexFlags flags)macro void mutex_destroy(void* addr, MutexFlags flags)macro void mutex_pre_lock(void* addr, MutexFlags flags)macro void mutex_post_lock(void* addr, MutexFlags flags, CInt recursion)macro CInt mutex_pre_unlock(void* addr, MutexFlags flags)macro void mutex_post_unlock(void* addr, MutexFlags flags)macro void mutex_pre_signal(void* addr, MutexFlags flags)macro void mutex_post_signal(void* addr, MutexFlags flags)macro void mutex_pre_divert(void* addr, MutexFlags flags)macro void mutex_post_divert(void* addr, MutexFlags flags)std::core::string
Section titled “std::core::string”typedef String @if(!$defined(String)) = inline char[]typedef ZString = inline char*typedef WString = inline Char16*alias Char32 = uintalias Char16 = ushortfaultdef INVALID_UTF8, INVALID_UTF16, CONVERSION_FAILED, EMPTY_STRING, NEGATIVE_VALUE, MALFORMED_INTEGER, INTEGER_OVERFLOW, MALFORMED_FLOAT, FLOAT_OUT_OF_RANGEmacro Char32* @wstring32(String $string) @builtinmacro Char32[] @char32(String $string) @builtinmacro WString @wstring(String $string) @builtinmacro Char16[] @char16(String $string) @builtinmacro String @sprintf(String $format, ...) @builtin @constfn ZString tformat_zstr(String fmt, args...) @format(0)fn String format(Allocator allocator, String fmt, args...) @format(1)fn String bformat(char[] buffer, String fmt, args...) @format(1)fn String tformat(String fmt, args...) @format(0)macro bool char_in_set(char c, String set)fn String join(Allocator allocator, String[] s, String joiner)fn String String.replace(self, Allocator allocator, String needle, String new_str) @nodiscardfn String String.treplace(self, String needle, String new_str)fn String String.trim(self, String to_trim = "\t\n\r ")fn String String.trim_left(self, String to_trim = "\t\n\r ")fn String String.trim_right(self, String to_trim = "\t\n\r ")fn bool String.starts_with(self, String prefix)fn bool String.ends_with(self, String suffix)fn String String.strip(self, String prefix)fn String String.strip_end(self, String suffix)fn String[] String.split(self, Allocator allocator, String delimiter, usz max = 0, bool skip_empty = false)fn String[] String.tsplit(s, String delimiter, usz max = 0, bool skip_empty = false)faultdef BUFFER_EXCEEDEDfn String[]? String.split_to_buffer(s, String delimiter, String[] buffer, usz max = 0, bool skip_empty = false)fn bool String.contains(s, String substr)fn usz String.count(self, String substr)fn usz? String.index_of_char(self, char character)fn usz? String.index_of_chars(String self, char[] characters)fn usz? String.index_of_char_from(self, char character, usz start_index)fn usz? String.rindex_of_char(self, char character)fn usz? String.index_of(self, String substr)fn usz? String.rindex_of(self, String substr)fn bool ZString.eq(self, ZString other) @operator(==)fn String ZString.str_view(self)fn usz ZString.char_len(str)fn usz ZString.len(self)fn usz WString.len(self)fn ZString String.zstr_copy(self, Allocator allocator)fn String String.concat(self, Allocator allocator, String s2)fn String String.tconcat(self, String s2)fn ZString String.zstr_tcopy(self)fn String String.copy(self, Allocator allocator)fn void String.free(&self, Allocator allocator)fn String String.tcopy(self)fn String ZString.copy(self, Allocator allocator)fn String ZString.tcopy(self)fn Char16[]? String.to_utf16(self, Allocator allocator)fn Char16[]? String.to_temp_utf16(self)fn WString? String.to_wstring(self, Allocator allocator)fn WString? String.to_temp_wstring(self)fn Char32[]? String.to_utf32(self, Allocator allocator)fn Char32[]? String.to_temp_utf32(self)fn void String.convert_to_lower(self)fn String String.to_lower_copy(self, Allocator allocator)fn String String.to_lower_tcopy(self)fn void String.convert_to_upper(self)fn String String.to_upper_copy(self, Allocator allocator)fn String String.capitalize_copy(self, Allocator allocator)fn String String.snake_to_pascal_copy(self, Allocator allocator)fn void String.convert_snake_to_pascal(&self)fn String String.pascal_to_snake_copy(self, Allocator allocator)fn StringIterator String.iterator(self)fn String String.to_upper_tcopy(self)fn String? from_utf32(Allocator allocator, Char32[] utf32)fn String? from_utf16(Allocator allocator, Char16[] utf16)fn String? from_wstring(Allocator allocator, WString wstring)fn String? tfrom_wstring(WString wstring)fn String? tfrom_utf16(Char16[] utf16)fn usz String.utf8_codepoints(s)fn bool String.is_zstr(self) @deprecated("Unsafe, use copy instead")fn ZString String.quick_zstr(self) @deprecated("Unsafe, use zstr_tcopy instead")macro String.to_integer(self, $Type, int base = 10)fn int128? String.to_int128(self, int base = 10)fn long? String.to_long(self, int base = 10)fn int? String.to_int(self, int base = 10)fn short? String.to_short(self, int base = 10)fn ichar? String.to_ichar(self, int base = 10)fn uint128? String.to_uint128(self, int base = 10)fn ulong? String.to_ulong(self, int base = 10)fn uint? String.to_uint(self, int base = 10)fn ushort? String.to_ushort(self, int base = 10)fn char? String.to_uchar(self, int base = 10)fn double? String.to_double(self)fn float? String.to_float(self)fn Splitter String.tokenize(self, String split)fn Splitter String.tokenize_all(self, String split, bool skip_last = false)fn Splitter String.splitter(self, String split) @deprecated("Use tokenize_all instead")macro String from_struct(Allocator allocator, x)macro String tfrom_struct(x)enum SplitterTypestruct Splitterfn void Splitter.reset(&self)fn String? Splitter.next(&self)faultdef INVALID_ESCAPE_SEQUENCE, UNTERMINATED_STRING, INVALID_HEX_ESCAPE, INVALID_UNICODE_ESCAPEfn String String.escape(String s, Allocator allocator, bool strip_quotes = true)fn String String.tescape(String s, bool strip_quotes = false)fn usz escape_len(String s)fn String? String.unescape(String s, Allocator allocator, bool allow_unquoted = false)fn String? String.tunescape(String s, bool allow_unquoted = false)fn bool needs_escape(char c)macro double? decfloat(char[] chars, int $bits, int $emin, int sign)macro double? hexfloat(char[] chars, int $bits, int $emin, int sign)std::core::string::ansi
Section titled “std::core::string::ansi”enum Ansi : const inline Stringmacro String color_8bit(char $index, bool $bg = false) @constmacro String color_rgb(char $r, char $g, char $b, bool $bg = false) @constmacro String color(uint $rgb, bool $bg = false) @constfn String make_color(Allocator mem, uint rgb, bool bg = false)fn String make_tcolor(uint rgb, bool bg = false)fn String make_color_rgb(Allocator mem, char r, char g, char b, bool bg = false)fn String make_tcolor_rgb(char r, char g, char b, bool bg = false)std::core::string::conv
Section titled “std::core::string::conv”fn usz? char32_to_utf8(Char32 c, char[] output)fn void char32_to_utf16_unsafe(Char32 c, Char16** output)fn void? char16_to_utf8_unsafe(Char16 *ptr, usz *available, char** output)fn usz char32_to_utf8_unsafe(Char32 c, char** output)fn Char32? utf8_to_char32(char* ptr, usz* size)fn usz utf8_codepoints(String utf8)fn usz utf8len_for_utf32(Char32[] utf32)fn usz utf8len_for_utf16(Char16[] utf16)fn usz utf16len_for_utf8(String utf8)fn usz utf16len_for_utf32(Char32[] utf32)fn usz? utf32to8(Char32[] utf32, char[] utf8_buffer)fn usz? utf8to32(String utf8, Char32[] utf32_buffer)fn void? utf16to8_unsafe(Char16[] utf16, char* utf8_buffer)fn void? utf8to32_unsafe(String utf8, Char32* utf32_buffer)fn void? utf8to16_unsafe(String utf8, Char16* utf16_buffer)fn void utf32to8_unsafe(Char32[] utf32, char* utf8_buffer)std::core::string::iterator
Section titled “std::core::string::iterator”struct StringIteratorfn void StringIterator.reset(&self)fn Char32? StringIterator.next(&self)fn Char32? StringIterator.peek(&self)fn bool StringIterator.has_next(&self)fn Char32? StringIterator.get(&self)std::core::test
Section titled “std::core::test”macro @setup(TestFn setup_fn, TestFn teardown_fn = null)macro @check(#condition, String format = "", args...)macro @error(#funcresult, fault error_expected)macro eq(left, right)macro void eq_approx(double left, double right, uint places = 7, double delta = 0, bool equal_nan = true)macro void ne(left, right)macro gt(left, right)macro ge(left, right)macro lt(left, right)macro le(left, right)std::core::types
Section titled “std::core::types”faultdef VALUE_OUT_OF_RANGE, VALUE_OUT_OF_UNSIGNED_RANGEmacro any_to_enum_ordinal(any v, $Type)macro any_to_int(any v, $Type)fn bool typeid.is_subtype_of(self, typeid other)macro bool is_subtype_of($Type, $OtherType)macro bool is_numerical($Type)fn bool TypeKind.is_int(kind) @inlinemacro bool is_slice_convertable($Type)macro bool is_bool($Type) @constmacro bool is_int($Type) @constmacro bool is_signed($Type) @constmacro bool is_unsigned($Type) @constmacro typeid flat_type($Type) @constmacro TypeKind flat_kind($Type) @constmacro bool is_indexable($Type) @constmacro bool is_ref_indexable($Type) @constmacro bool is_flat_intlike($Type) @constmacro bool is_intlike($Type) @constmacro bool is_underlying_int($Type) @constmacro bool is_float($Type) @constmacro bool is_floatlike($Type) @constmacro bool is_vector($Type) @constmacro typeid inner_type($Type) @constmacro TypeKind inner_kind($Type) @constmacro bool is_same($TypeA, $TypeB) @constmacro bool @has_same(#a, #b, ...) @constmacro bool may_load_atomic($Type) @constmacro lower_to_atomic_compatible_type($Type) @constmacro bool is_promotable_to_floatlike($Type) @constmacro bool is_promotable_to_float($Type) @constmacro bool is_same_vector_type($Type1, $Type2) @constmacro bool is_equatable_type($Type) @constmacro bool implements_copy($Type) @constmacro bool @equatable_value(#value) @constmacro bool @comparable_value(#value) @constenum TypeKind : charstruct TypeEnumstd::core::values
Section titled “std::core::values”macro bool @is_same_type(#value1, #value2) @constmacro bool @is_bool(#value) @constmacro bool @is_int(#value) @constmacro bool @is_flat_intlike(#value) @constmacro bool @is_floatlike(#value) @constmacro bool @is_float(#value) @constmacro bool @is_promotable_to_floatlike(#value) @constmacro bool @is_promotable_to_float(#value) @constmacro bool @is_vector(#value) @constmacro bool @is_same_vector_type(#value1, #value2) @constmacro bool @assign_to(#value1, #value2) @constmacro bool @is_lvalue(#value)macro bool @is_const(#foo) @const @builtinmacro promote_int(x)macro @select(bool $bool, #value_1, #value_2) @builtinmacro promote_int_same(x, y)macro TypeKind @inner_kind(#value) @conststd::crypto
Section titled “std::crypto”fn bool safe_compare(void* data1, void* data2, usz len)std::crypto::dh
Section titled “std::crypto::dh”fn BigInt generate_secret(BigInt p, BigInt x, BigInt y)fn BigInt public_key(BigInt p, BigInt g, BigInt x)std::crypto::ed25519
Section titled “std::crypto::ed25519”alias Ed25519PrivateKey = char[32]alias Ed25519PublicKey = char[Ed25519PrivateKey.len]alias Ed25519Signature = char[2 * Ed25519PublicKey.len]fn Ed25519PublicKey public_keygen(char[] private_key)fn Ed25519Signature sign(char[] message, char[] private_key, char[] public_key)fn bool verify(char[] message, char[] signature, char[] public_key)std::crypto::rc4
Section titled “std::crypto::rc4”struct Rc4fn void Rc4.init(&self, char[] key)fn void crypt(char[] key, char[] data)fn void Rc4.crypt(&self, char[] in, char[] out)fn void Rc4.destroy(&self)std::encoding
Section titled “std::encoding”faultdef INVALID_CHARACTER, INVALID_PADDINGstd::encoding::base32
Section titled “std::encoding::base32”struct Base32Alphabetfn String? encode(Allocator allocator, char[] src, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD)fn char[]? decode(Allocator allocator, char[] src, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD)fn String? tencode(char[] code, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD) @inlinefn char[]? tdecode(char[] code, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD) @inlinefn usz decode_len(usz n, char padding)fn usz encode_len(usz n, char padding)fn char[]? decode_buffer(char[] src, char[] dst, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD)fn String encode_buffer(char[] src, char[] dst, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD)typedef Alphabet = char[32]std::encoding::base64
Section titled “std::encoding::base64”struct Base64Alphabetfn String encode(Allocator allocator, char[] src, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD)fn char[]? decode(Allocator allocator, char[] src, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD)fn String tencode(char[] code, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD) @inlinefn char[]? tdecode(char[] code, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD) @inlinefn usz encode_len(usz n, char padding)fn usz? decode_len(usz n, char padding)fn String encode_buffer(char[] src, char[] dst, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD)fn char[]? decode_buffer(char[] src, char[] dst, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD)std::encoding::csv
Section titled “std::encoding::csv”struct CsvReaderstruct CsvRow (Printable)fn usz? CsvRow.to_format(&self, Formatter* f) @dynamicfn usz CsvRow.len(&self) @operator(len)fn String CsvRow.get_col(&self, usz col) @operator([])fn void CsvReader.init(&self, InStream stream, String separator = ",")fn CsvRow? CsvReader.read_row(self, Allocator allocator)fn CsvRow? CsvReader.tread_row(self)fn void CsvRow.free(&self)fn void? CsvReader.skip_row(self) @maydiscardmacro void? @each_row(InStream stream, String separator = ",", int max_rows = int.max; @body(String[] row)) @maydiscardmacro void? CsvReader.@each_row(self, int rows = int.max; @body(String[] row)) @maydiscardstd::encoding::hex
Section titled “std::encoding::hex”fn String encode_buffer(char[] code, char[] buffer)fn char[]? decode_buffer(char[] code, char[] buffer)fn String encode(Allocator allocator, char[] code)fn char[]? decode(Allocator allocator, char[] code)fn String tencode(char[] code) @inlinefn char[]? tdecode(char[] code) @inlinefn usz encode_len(usz n)fn usz encode_bytes(char[] src, char[] dst)macro usz decode_len(usz n)fn usz? decode_bytes(char[] src, char[] dst)std::encoding::json
Section titled “std::encoding::json”faultdef UNEXPECTED_CHARACTER, INVALID_ESCAPE_SEQUENCE, INVALID_NUMBER, MAX_DEPTH_REACHEDfn Object*? parse_string(Allocator allocator, String s)fn Object*? tparse_string(String s)fn Object*? parse(Allocator allocator, InStream s)fn Object*? tparse(InStream s)fn JsonTokenType? lex_string(JsonContext* context)std::experimental::scheduler{Event}
Section titled “std::experimental::scheduler{Event}”struct FrameSchedulerfn void FrameScheduler.init(&self)macro void FrameScheduler.@destroy(&self; @destruct(Event e))fn void FrameScheduler.queue_delayed_event(&self, Event event, Duration delay)fn bool FrameScheduler.has_delayed(&self)fn void FrameScheduler.queue_event(&self, Event event)fn Event? FrameScheduler.pop_event(&self)std::hash::a5hash
Section titled “std::hash::a5hash”fn ulong hash(char[] data, ulong seed = 0)std::hash::adler32
Section titled “std::hash::adler32”struct Adler32fn void Adler32.init(&self)fn void Adler32.updatec(&self, char c)fn void Adler32.update(&self, char[] data)fn uint Adler32.final(&self)fn uint hash(char[] data)std::hash::crc32
Section titled “std::hash::crc32”struct Crc32fn void Crc32.init(&self, uint seed = 0)fn void Crc32.updatec(&self, char c)fn void Crc32.update(&self, char[] data)fn uint Crc32.final(&self)fn uint hash(char[] data)std::hash::crc64
Section titled “std::hash::crc64”struct Crc64fn void Crc64.init(&self, uint seed = 0)fn void Crc64.updatec(&self, char c)fn void Crc64.update(&self, char[] data)fn ulong Crc64.final(&self)fn ulong hash(char[] data)std::hash::fnv32a
Section titled “std::hash::fnv32a”typedef Fnv32a = uintfn void Fnv32a.init(&self)fn void Fnv32a.update(&self, char[] data)macro void Fnv32a.update_char(&self, char c)fn uint hash(char[] data)std::hash::fnv64a
Section titled “std::hash::fnv64a”typedef Fnv64a = ulongfn void Fnv64a.init(&self)fn void Fnv64a.update(&self, char[] data)macro void Fnv64a.update_char(&self, char c)fn ulong hash(char[] data)std::hash::hmac{HashAlg, HASH_BYTES, BLOCK_BYTES}
Section titled “std::hash::hmac{HashAlg, HASH_BYTES, BLOCK_BYTES}”struct Hmacfn char[HASH_BYTES] hash(char[] key, char[] message)fn void pbkdf2(char[] pw, char[] salt, uint iterations, char[] output)fn void Hmac.init(&self, char[] key)fn void Hmac.update(&self, char[] data)fn char[HASH_BYTES] Hmac.final(&self)macro @derive(Hmac *hmac_start, char[] salt, uint iterations, usz index, char[] out)std::hash::komi
Section titled “std::hash::komi”fn ulong hash(char[] data, ulong seed = 0)std::hash::md5
Section titled “std::hash::md5”struct Md5alias HmacMd5 = Hmac{Md5, HASH_BYTES, BLOCK_BYTES}alias hmac = hmac::hash{Md5, HASH_BYTES, BLOCK_BYTES}alias pbkdf2 = hmac::pbkdf2{Md5, HASH_BYTES, BLOCK_BYTES}fn char[HASH_BYTES] hash(char[] data)fn void Md5.init(&self)fn void Md5.update(&ctx, char[] data)fn char[HASH_BYTES] Md5.final(&ctx)std::hash::metro128
Section titled “std::hash::metro128”struct MetroHash128fn uint128 hash(char[] data, ulong seed = 0)fn void MetroHash128.init(&self, ulong seed = 0)fn void MetroHash128.update(&self, char[] data)fn uint128 MetroHash128.final(&self)std::hash::metro64
Section titled “std::hash::metro64”struct MetroHash64fn ulong hash(char[] data, ulong seed = 0)fn void MetroHash64.init(&self, ulong seed = 0)fn void MetroHash64.update(&self, char[] data)fn ulong MetroHash64.final(&self)std::hash::sha1
Section titled “std::hash::sha1”struct Sha1alias HmacSha1 = Hmac{Sha1, HASH_BYTES, BLOCK_BYTES}alias hmac = hmac::hash{Sha1, HASH_BYTES, BLOCK_BYTES}alias pbkdf2 = hmac::pbkdf2{Sha1, HASH_BYTES, BLOCK_BYTES}fn char[HASH_BYTES] hash(char[] data)fn void Sha1.init(&self)fn void Sha1.update(&self, char[] data)fn char[HASH_BYTES] Sha1.final(&self)std::hash::sha256
Section titled “std::hash::sha256”struct Sha256alias HmacSha256 = Hmac{Sha256, HASH_SIZE, BLOCK_SIZE}alias hmac = hmac::hash{Sha256, HASH_SIZE, BLOCK_SIZE}alias pbkdf2 = hmac::pbkdf2{Sha256, HASH_SIZE, BLOCK_SIZE}fn char[HASH_SIZE] hash(char[] data)fn void Sha256.init(&self)fn void Sha256.update(&self, char[] data)fn char[HASH_SIZE] Sha256.final(&self)std::hash::sha512
Section titled “std::hash::sha512”struct Sha512alias HmacSha512 = Hmac{Sha512, HASH_SIZE, BLOCK_SIZE}alias hmac = hmac::hash{Sha512, HASH_SIZE, BLOCK_SIZE}alias pbkdf2 = hmac::pbkdf2{Sha512, HASH_SIZE, BLOCK_SIZE}enum HashTruncationType : uint (uint truncation_width, ulong[8] initial_state)fn char[HASH_SIZE] hash(char[] data)fn void Sha512.init(&self)fn void Sha512.update(&self, char[] data)fn char[HASH_SIZE] Sha512.final(&self)std::hash::siphash { OutType, BLOCK_ROUNDS, FINALIZE_ROUNDS }
Section titled “std::hash::siphash { OutType, BLOCK_ROUNDS, FINALIZE_ROUNDS }”struct SipHashfn OutType hash(char[] data, uint128 key)fn void SipHash.init(&self, uint128 key)fn void SipHash.update(&self, char[] data)fn OutType SipHash.final(&self)std::hash::siphash24
Section titled “std::hash::siphash24”alias SipHash24 = SipHash { ulong, 2, 4 }alias hash = siphash::hash { ulong, 2, 4 }std::hash::siphash24_128
Section titled “std::hash::siphash24_128”alias SipHash24_128 = SipHash { uint128, 2, 4 }alias hash = siphash::hash { uint128, 2, 4 }std::hash::siphash48
Section titled “std::hash::siphash48”alias SipHash48 = SipHash { ulong, 4, 8 }alias hash = siphash::hash { ulong, 4, 8 }std::hash::siphash48_128
Section titled “std::hash::siphash48_128”alias SipHash48_128 = SipHash { uint128, 4, 8 }alias hash = siphash::hash { uint128, 4, 8 }std::hash::whirlpool
Section titled “std::hash::whirlpool”struct Whirlpoolalias HmacWhirlpool = Hmac { Whirlpool, HASH_SIZE, BLOCK_SIZE }alias hmac = hmac::hash { Whirlpool, HASH_SIZE, BLOCK_SIZE }alias pbkdf2 = hmac::pbkdf2 { Whirlpool, HASH_SIZE, BLOCK_SIZE }fn char[HASH_SIZE] hash(char[] data)macro void Whirlpool.init(&self)fn void Whirlpool.update(&self, char[] data)fn char[HASH_SIZE] Whirlpool.final(&self)std::hash::wyhash2
Section titled “std::hash::wyhash2”fn ulong wyr3(char* in, usz len) @inlinefn ulong hash(char[] input, ulong seed = 0)std::io
Section titled “std::io”struct BitReaderfn void BitReader.init(&self, InStream byte_reader)fn void BitReader.clear(&self) @inlinefn char? BitReader.read_bits(&self, uint nbits)struct BitWriterfn void BitWriter.init(&self, OutStream byte_writer)fn void? BitWriter.flush(&self)fn void? BitWriter.write_bits(&self, uint bits, uint nbits)struct File (InStream, OutStream)faultdef BUFFER_EXCEEDED, INTERNAL_BUFFER_EXCEEDED, INVALID_FORMAT, NOT_ENOUGH_ARGUMENTS, INVALID_ARGUMENTalias OutputFn = fn void?(void* buffer, char c)alias FloatType = doublemacro bool is_struct_with_default_print($Type)macro usz? struct_to_format(value, Formatter* f, bool $force_dump)fn usz? ReflectedParam.to_format(&self, Formatter* f) @dynamicfn usz? Formatter.printf(&self, String format, args...)struct Formatterbitstruct PrintFlags : uintfn void Formatter.init(&self, OutputFn out_fn, void* data = null)fn usz? Formatter.print_with_function(&self, Printable arg)macro usz? @report_fault(Formatter* f, $fault)macro usz? @wrap_bad(Formatter* f, #action)fn usz? Formatter.vprintf(&self, String format, any[] anys)fn usz? Formatter.print(&self, String str)faultdef BAD_FORMATfn usz? print_hex_chars(Formatter* f, char[] out, bool uppercase) @inlinemacro Formatter.first_err(&self, fault f)fn usz? Formatter.pad(&self, char c, isz width, isz len) @inlinefn char* fmt_u(uint128 x, char* s)fn usz? Formatter.out_chars(&self, char[] s)enum FloatFormattingfn usz? Formatter.etoa(&self, double y)fn usz? Formatter.ftoa(&self, double y)fn usz? Formatter.gtoa(&self, double y)fn usz? Formatter.atoa(&self, double y)enum Seekfaultdef ALREADY_EXISTS, BUSY, CANNOT_READ_DIR, DIR_NOT_EMPTY, PARENT_DIR_MISSING, EOF, FILE_CANNOT_DELETE, FILE_IS_DIR, FILE_IS_PIPE, FILE_NOT_DIR, FILE_NOT_FOUND, FILE_NOT_VALID, GENERAL_ERROR, ILLEGAL_ARGUMENT, INCOMPLETE_WRITE, INTERRUPTED, INVALID_POSITION, INVALID_PUSHBACK, NAME_TOO_LONG, NOT_SEEKABLE, NO_PERMISSION, OUT_OF_SPACE, OVERFLOW, READ_ONLY, SYMLINK_FAILED, TOO_MANY_DESCRIPTORS, UNEXPECTED_EOF, UNKNOWN_ERROR, UNSUPPORTED_OPERATION, WOULD_BLOCKmacro String? readline(Allocator allocator, stream = io::stdin())macro String? treadline(stream = io::stdin())macro usz? readline_to_stream(out_stream, in_stream = io::stdin())macro usz? fprint(out, x)fn usz? fprintf(OutStream out, String format, args...) @format(1)fn usz? fprintfn(OutStream out, String format, args...) @format(1) @maydiscardmacro usz? fprintn(out, x = "")macro void print(x)macro void printn(x = "")macro void eprint(x)macro void eprintn(x)fn usz? printf(String format, args...) @format(0) @maydiscardfn usz? printfn(String format, args...) @format(0) @maydiscardfn usz? eprintf(String format, args...) @maydiscardfn usz? eprintfn(String format, args...) @maydiscardfn char[]? bprintf(char[] buffer, String format, args...) @maydiscardfn usz? available(InStream s)macro bool @is_instream(#expr)macro bool @is_outstream(#expr)macro usz? read_any(stream, any ref)macro usz? write_any(stream, any ref)macro usz? read_all(stream, char[] buffer)macro char[]? read_fully(Allocator allocator, stream)macro usz? write_all(stream, char[] buffer)macro usz? read_using_read_byte(s, char[] buffer)macro void? write_byte_using_write(s, char c)macro char? read_byte_using_read(s)alias ReadByteFn = fn char?()macro usz? write_using_write_byte(s, char[] bytes)macro void? pushback_using_seek(s)fn usz? copy_to(InStream in, OutStream dst, char[] buffer = {})macro usz? read_varint(stream, x_ptr)macro usz? write_varint(stream, x)macro ushort? read_be_ushort(stream)macro short? read_be_short(stream)macro void? write_be_short(stream, ushort s)macro uint? read_be_uint(stream)macro int? read_be_int(stream)macro void? write_be_int(stream, uint s)macro ulong? read_be_ulong(stream)macro long? read_be_long(stream)macro void? write_be_long(stream, ulong s)macro uint128? read_be_uint128(stream)macro int128? read_be_int128(stream)macro void? write_be_int128(stream, uint128 s)macro usz? write_tiny_bytearray(stream, char[] data)macro char[]? read_tiny_bytearray(stream, Allocator allocator)macro usz? write_short_bytearray(stream, char[] data)macro char[]? read_short_bytearray(stream, Allocator allocator)fn ByteReader wrap_bytes(char[] bytes)struct ReadBuffer (InStream)fn ReadBuffer* ReadBuffer.init(&self, InStream wrapped_stream, char[] bytes)fn String ReadBuffer.str_view(&self) @inlinefn void? ReadBuffer.close(&self) @dynamicfn usz? ReadBuffer.read(&self, char[] bytes) @dynamicfn char? ReadBuffer.read_byte(&self) @dynamicstruct WriteBuffer (OutStream)fn WriteBuffer* WriteBuffer.init(&self, OutStream wrapped_stream, char[] bytes)fn String WriteBuffer.str_view(&self) @inlinefn void? WriteBuffer.close(&self) @dynamicfn void? WriteBuffer.flush(&self) @dynamicfn usz? WriteBuffer.write(&self, char[] bytes) @dynamicfn void? WriteBuffer.write_byte(&self, char c) @dynamicstruct ByteBuffer (InStream, OutStream)fn ByteBuffer* ByteBuffer.init(&self, Allocator allocator, usz max_read, usz initial_capacity = 16)fn ByteBuffer* ByteBuffer.tinit(&self, usz max_read, usz initial_capacity = 16)fn ByteBuffer* ByteBuffer.init_with_buffer(&self, char[] buf)fn void ByteBuffer.free(&self)fn usz? ByteBuffer.write(&self, char[] bytes) @dynamicfn void? ByteBuffer.write_byte(&self, char c) @dynamicfn usz? ByteBuffer.read(&self, char[] bytes) @dynamicfn char? ByteBuffer.read_byte(&self) @dynamicfn void? ByteBuffer.pushback_byte(&self) @dynamicfn usz? ByteBuffer.seek(&self, isz offset, Seek seek) @dynamicfn usz? ByteBuffer.available(&self) @inline @dynamicfn void ByteBuffer.grow(&self, usz n)macro ByteBuffer.shrink(&self)struct ByteReader (InStream)fn usz ByteReader.len(&self) @dynamicfn ByteReader* ByteReader.init(&self, char[] bytes)fn usz? ByteReader.read(&self, char[] bytes) @dynamicfn char? ByteReader.read_byte(&self) @dynamicfn void? ByteReader.pushback_byte(&self) @dynamicfn usz? ByteReader.seek(&self, isz offset, Seek seek) @dynamicfn usz? ByteReader.write_to(&self, OutStream writer) @dynamicfn usz? ByteReader.available(&self) @inline @dynamicstruct ByteWriter (OutStream)fn ByteWriter* ByteWriter.init(&self, Allocator allocator)fn ByteWriter* ByteWriter.tinit(&self)fn ByteWriter* ByteWriter.init_with_buffer(&self, char[] data)fn void? ByteWriter.destroy(&self) @dynamicfn String ByteWriter.str_view(&self) @inlinefn void? ByteWriter.ensure_capacity(&self, usz len) @inlinefn usz? ByteWriter.write(&self, char[] bytes) @dynamicfn void? ByteWriter.write_byte(&self, char c) @dynamicfn usz? ByteWriter.read_from(&self, InStream reader) @dynamicstruct LimitReader (InStream)fn LimitReader* LimitReader.init(&self, InStream wrapped_stream, usz limit)fn void? LimitReader.close(&self) @dynamicfn usz? LimitReader.read(&self, char[] bytes) @dynamicfn char? LimitReader.read_byte(&self) @dynamicfn usz? LimitReader.available(&self) @inline @dynamicstruct MultiReader (InStream)fn MultiReader* MultiReader.init(&self, Allocator allocator, InStream... readers)fn MultiReader* MultiReader.tinit(&self, InStream... readers)fn void MultiReader.free(&self)fn usz? MultiReader.read(&self, char[] bytes) @dynamicfn char? MultiReader.read_byte(&self) @dynamicstruct MultiWriter (OutStream)fn MultiWriter* MultiWriter.init(&self, Allocator allocator, OutStream... writers)fn MultiWriter* MultiWriter.tinit(&self, OutStream... writers)fn void MultiWriter.free(&self)fn usz? MultiWriter.write(&self, char[] bytes) @dynamicfn void? MultiWriter.write_byte(&self, char c) @dynamicstruct Scanner (InStream)fn void Scanner.init(&self, InStream stream, char[] buffer)fn char[] Scanner.flush(&self) @dynamicfn void? Scanner.close(&self) @dynamicfn char[]? Scanner.scan(&self, String pattern = "\n")fn usz? Scanner.read(&self, char[] bytes) @dynamicfn char? Scanner.read_byte(&self) @dynamicstruct TeeReader (InStream)macro TeeReader tee_reader(InStream r, OutStream w)fn TeeReader* TeeReader.init(&self, InStream r, OutStream w)fn usz? TeeReader.read(&self, char[] bytes) @dynamicfn char? TeeReader.read_byte(&self) @dynamicstd::io @if (env::LIBC)
Section titled “std::io @if (env::LIBC)”fn void putchar(char c) @inlinefn File* stdout()fn File* stderr()fn File* stdin()std::io @if(!env::LIBC)
Section titled “std::io @if(!env::LIBC)”fn void putchar(char c) @inlinefn File* stdout()fn File* stderr()fn File* stdin()std::io::file
Section titled “std::io::file”fn File? open(String filename, String mode)fn File? open_path(Path path, String mode)fn bool exists(String file)fn File from_handle(CFile file)fn bool is_file(String path)fn bool is_dir(String path)fn usz? get_size(String path)fn void? delete(String filename)fn void? File.reopen(&self, String filename, String mode)fn usz? File.seek(&self, isz offset, Seek seek_mode = Seek.SET) @dynamicfn void? File.write_byte(&self, char c) @dynamicfn void? File.close(&self) @inline @dynamicfn bool File.eof(&self) @inlinefn usz? File.read(&self, char[] buffer) @dynamicfn usz? File.write(&self, char[] buffer) @dynamicfn Fd File.fd(self) @if(env::LIBC)fn bool File.isatty(self) @if(env::LIBC)fn char? File.read_byte(&self) @dynamicfn char[]? load_buffer(String filename, char[] buffer)fn char[]? load(Allocator allocator, String filename)fn char[]? load_path(Allocator allocator, Path path)fn char[]? load_temp(String filename)fn char[]? load_path_temp(Path path)fn void? save(String filename, char[] data)fn void? File.flush(&self) @dynamicstd::io::os
Section titled “std::io::os”macro void? native_chdir(Path path)fn void? native_stat(Stat* stat, String path) @if(env::DARWIN || env::LINUX || env::ANDROID || env::BSD_FAMILY)fn usz? native_file_size(String path) @if(env::WIN32)fn usz? native_file_size(String path) @if(!env::WIN32 && !env::DARWIN)fn usz? native_file_size(String path) @if(env::DARWIN)fn bool native_file_or_dir_exists(String path)fn bool native_is_file(String path)fn bool native_is_dir(String path)macro String? getcwd(Allocator allocator)macro bool? native_mkdir(Path path, MkdirPermissions permissions)macro bool? native_rmdir(Path path)std::io::os @if(env::LIBC)
Section titled “std::io::os @if(env::LIBC)”fn void*? native_fopen(String filename, String mode) @inlinefn void? native_remove(String filename)fn void*? native_freopen(void* file, String filename, String mode) @inlinefn void? native_fseek(void* file, isz offset, Seek seek_mode) @inlinefn usz? native_ftell(CFile file) @inlinefn usz? native_fwrite(CFile file, char[] buffer) @inlinefn void? native_fputc(CInt c, CFile stream) @inlinefn usz? native_fread(CFile file, char[] buffer) @inlinefn Path? native_temp_directory(Allocator allocator) @if(!env::WIN32)fn Path? native_temp_directory(Allocator allocator) @if(env::WIN32)std::io::os @if(env::NO_LIBC)
Section titled “std::io::os @if(env::NO_LIBC)”alias FopenFn = fn void*?(String, String)alias FreopenFn = fn void*?(void*, String, String)alias FcloseFn = fn void?(void*)alias FseekFn = fn void?(void*, isz, Seek)alias FtellFn = fn usz?(void*)alias FwriteFn = fn usz?(void*, char[] buffer)alias FreadFn = fn usz?(void*, char[] buffer)alias RemoveFn = fn void?(String)alias FputcFn = fn void?(int, void*)fn @weak @if(!$defined(native_fopen_fn))fn void? native_remove(String filename) @inlinefn void*? native_freopen(void* file, String filename, String mode) @inlinefn void? native_fseek(void* file, isz offset, Seek seek_mode) @inlinefn usz? native_ftell(CFile file) @inlinefn usz? native_fwrite(CFile file, char[] buffer) @inlinefn usz? native_fread(CFile file, char[] buffer) @inlinefn void? native_fputc(CInt c, CFile stream) @inlinemacro Path? native_temp_directory(Allocator allocator)std::io::os @if(env::POSIX)
Section titled “std::io::os @if(env::POSIX)”fn PathList? native_ls(Path dir, bool no_dirs, bool no_symlinks, String mask, Allocator allocator)fn void? native_rmtree(Path dir)std::io::os @if(env::WIN32)
Section titled “std::io::os @if(env::WIN32)”fn PathList? native_ls(Path dir, bool no_dirs, bool no_symlinks, String mask, Allocator allocator)fn void? native_rmtree(Path path)std::io::path
Section titled “std::io::path”alias PathList = List { Path }faultdef INVALID_PATH, NO_PARENTalias Path = PathImpstruct PathImp (Printable)enum PathEnvfn Path? cwd(Allocator allocator)fn bool is_dir(Path path)fn bool is_file(Path path)fn usz? file_size(Path path)fn bool exists(Path path)fn Path? tcwd()macro void? chdir(path)fn Path? temp_directory(Allocator allocator)fn void? delete(Path path)macro bool @is_pathlike(#path)macro bool is_separator(char c, PathEnv path_env = DEFAULT_ENV)macro bool is_posix_separator(char c)macro bool is_win32_separator(char c)fn PathList? ls(Allocator allocator, Path dir, bool no_dirs = false, bool no_symlinks = false, String mask = "")enum MkdirPermissionsmacro bool? mkdir(path, bool recursive = false, MkdirPermissions permissions = NORMAL)macro bool? rmdir(path)fn void? rmtree(Path path)fn Path? new(Allocator allocator, String path, PathEnv path_env = DEFAULT_ENV)fn Path? temp(String path, PathEnv path_env = DEFAULT_ENV)fn Path? from_wstring(Allocator allocator, WString path)fn Path? from_win32_wstring(Allocator allocator, WString path) @deprecated("Use 'from_wstring' instead")fn Path? for_windows(Allocator allocator, String path)fn Path? for_posix(Allocator allocator, String path)fn bool Path.equals(self, Path p2) @operator(==)fn Path? Path.append(self, Allocator allocator, String filename)fn Path? Path.tappend(self, String filename)fn bool? String.is_absolute_path(self)fn bool? Path.is_absolute(self)fn Path? String.to_absolute_path(self, Allocator allocator)fn Path? Path.absolute(self, Allocator allocator)fn String? String.file_basename(self, Allocator allocator)fn String? String.file_tbasename(self)fn String Path.basename(self)fn String? String.path_tdirname(self)fn String? String.path_dirname(self, Allocator allocator)fn String Path.dirname(self)fn bool Path.has_extension(self, String extension)fn String? Path.extension(self)fn String Path.volume_name(self)fn Path? String.to_path(self, Allocator allocator)fn Path? String.to_tpath(self)fn Path? Path.parent(self)fn String? normalize(String path_str, PathEnv path_env = DEFAULT_ENV)fn ZString Path.as_zstr(self) @deprecatedfn String Path.root_directory(self)alias PathWalker = fn bool? (Path, bool is_dir, void*)fn bool? Path.walk(self, PathWalker w, void* data)alias TraverseCallback = fn bool? (Path, bool is_dir, any data)fn bool? traverse(Path path, TraverseCallback callback, any data)fn String Path.str_view(self) @inlinefn bool Path.has_suffix(self, String str)fn void Path.free(self)fn usz? Path.to_format(&self, Formatter* formatter) @dynamicmacro bool is_reserved_win32_path_char(char c)macro bool is_reserved_path_char(char c, PathEnv path_env = DEFAULT_ENV)std::math
Section titled “std::math”alias Complexf = Complex {float}alias Complex = Complex {double}alias COMPLEX_IDENTITY @builtin = complex::IDENTITY {double}alias COMPLEXF_IDENTITY @builtin = complex::IDENTITY {float}alias IMAGINARY @builtin @deprecated("Use I") = complex::IMAGINARY { double }alias IMAGINARYF @builtin @deprecated("Use I_F") = complex::IMAGINARY { float }alias I @builtin = complex::IMAGINARY { double }alias I_F @builtin = complex::IMAGINARY { float }enum RoundingMode : intfaultdef OVERFLOW, MATRIX_INVERSE_DOESNT_EXISTmacro deg_to_rad(x)macro abs(x)macro is_approx(x, y, eps)macro is_approx_rel(x, y, eps)macro sign(x)macro atan2(x, y)macro sincos_ref(x, sinp, cosp)macro sincos(x)macro atan(x)macro atanh(x)macro acos(x)macro acosh(x)macro asin(x)macro asinh(x)macro ceil(x)macro @ceil($input) @constmacro clamp(x, lower, upper)macro copysign(mag, sgn)macro cos(x)macro cosec(x)macro cosech(x)macro cosh(x)macro cotan(x)macro cotanh(x)macro exp(x)macro exp2(x)macro floor(x)macro fma(a, b, c)macro hypot(x, y)macro ln(x)macro log(x, base)macro log2(x)macro log10(x)macro max(x, y, ...)macro min(x, y, ...)macro muladd(a, b, c)macro nearbyint(x)macro pow(x, exp)macro frexp(x, int* e)macro int signbit(x)macro rint(x)macro round(x)macro round_to_decimals(x, int decimal_places)macro roundeven(x)macro sec(x)macro sech(x)macro sin(x)macro sinh(x)macro sqr(x)macro sqrt(x)macro tan(x)macro bool is_finite(x)macro is_nan(x)macro is_inf(x)macro tanh(x)macro trunc(x)macro select(bool[<*>] mask, then_value, else_value)macro float float.ceil(float x)macro float float.clamp(float x, float lower, float upper)macro float float.copysign(float mag, float sgn)macro float float.floor(float x)macro float float.fma(float a, float b, float c)macro float float.muladd(float a, float b, float c)macro float float.nearbyint(float x)macro float float.pow(float x, exp)macro float float.rint(float x)macro float float.round(float x)macro float float.roundeven(float x)macro float float.trunc(float x)macro float float[<*>].sum(float[<*>] x, float start = 0.0)macro float float[<*>].product(float[<*>] x, float start = 1.0)macro float float[<*>].max(float[<*>] x)macro float float[<*>].min(float[<*>] x)macro float[<*>] float[<*>].ceil(float[<*>] x)macro float[<*>] float[<*>].clamp(float[<*>] x, float[<*>] lower, float[<*>] upper)macro float[<*>] float[<*>].copysign(float[<*>] mag, float[<*>] sgn)macro float[<*>] float[<*>].fma(float[<*>] a, float[<*>] b, float[<*>] c)macro float[<*>] float[<*>].floor(float[<*>] x)macro float[<*>] float[<*>].nearbyint(float[<*>] x)macro float[<*>] float[<*>].pow(float[<*>] x, exp)macro float[<*>] float[<*>].rint(float[<*>] x)macro float[<*>] float[<*>].round(float[<*>] x)macro float[<*>] float[<*>].roundeven(float[<*>] x)macro float[<*>] float[<*>].trunc(float[<*>] x)macro float float[<*>].dot(float[<*>] x, float[<*>] y)macro float float[<*>].length(float[<*>] x)macro float float[<*>].distance(float[<*>] x, float[<*>] y)macro float[<*>] float[<*>].normalize(float[<*>] x)macro float[<*>] float[<*>].lerp(float[<*>] x, float[<*>] y, float amount)macro float[<*>] float[<*>].reflect(float[<*>] x, float[<*>] y)macro bool float[<*>].equals(float[<*>] x, float[<*>] y)macro bool[<*>] float[<*>].comp_lt(float[<*>] x, float[<*>] y)macro bool[<*>] float[<*>].comp_le(float[<*>] x, float[<*>] y)macro bool[<*>] float[<*>].comp_eq(float[<*>] x, float[<*>] y)macro bool[<*>] float[<*>].comp_gt(float[<*>] x, float[<*>] y)macro bool[<*>] float[<*>].comp_ge(float[<*>] x, float[<*>] y)macro bool[<*>] float[<*>].comp_ne(float[<*>] x, float[<*>] y)macro double double.ceil(double x)macro double double.clamp(double x, double lower, double upper)macro double double.copysign(double mag, double sgn)macro double double.floor(double x)macro double double.fma(double a, double b, double c)macro double double.muladd(double a, double b, double c)macro double double.nearbyint(double x)macro double double.pow(double x, exp)macro double double.rint(double x)macro double double.round(double x)macro double double.roundeven(double x)macro double double.trunc(double x)macro double double[<*>].sum(double[<*>] x, double start = 0.0)macro double double[<*>].product(double[<*>] x, double start = 1.0)macro double double[<*>].max(double[<*>] x)macro double double[<*>].min(double[<*>] x)macro double[<*>] double[<*>].ceil(double[<*>] x)macro double[<*>] double[<*>].clamp(double[<*>] x, double[<*>] lower, double[<*>] upper)macro double[<*>] double[<*>].copysign(double[<*>] mag, double[<*>] sgn)macro double[<*>] double[<*>].floor(double[<*>] x)macro double[<*>] double[<*>].fma(double[<*>] a, double[<*>] b, double[<*>] c)macro double[<*>] double[<*>].nearbyint(double[<*>] x)macro double[<*>] double[<*>].pow(double[<*>] x, exp)macro double[<*>] double[<*>].rint(double[<*>] x)macro double[<*>] double[<*>].round(double[<*>] x)macro double[<*>] double[<*>].roundeven(double[<*>] x)macro double[<*>] double[<*>].trunc(double[<*>] x)macro double double[<*>].dot(double[<*>] x, double[<*>] y)macro double double[<*>].length(double[<*>] x)macro double double[<*>].distance(double[<*>] x, double[<*>] y)macro double[<*>] double[<*>].normalize(double[<*>] x)macro double[<*>] double[<*>].reflect(double[<*>] x, double[<*>] y)macro double[<*>] double[<*>].lerp(double[<*>] x, double[<*>] y, double amount)macro bool double[<*>].equals(double[<*>] x, double[<*>] y)macro bool[<*>] double[<*>].comp_lt(double[<*>] x, double[<*>] y)macro bool[<*>] double[<*>].comp_le(double[<*>] x, double[<*>] y)macro bool[<*>] double[<*>].comp_eq(double[<*>] x, double[<*>] y)macro bool[<*>] double[<*>].comp_gt(double[<*>] x, double[<*>] y)macro bool[<*>] double[<*>].comp_ge(double[<*>] x, double[<*>] y)macro bool[<*>] double[<*>].comp_ne(double[<*>] x, double[<*>] y)macro bool[<*>] ichar[<*>].comp_lt(ichar[<*>] x, ichar[<*>] y)macro bool[<*>] ichar[<*>].comp_le(ichar[<*>] x, ichar[<*>] y)macro bool[<*>] ichar[<*>].comp_eq(ichar[<*>] x, ichar[<*>] y)macro bool[<*>] ichar[<*>].comp_gt(ichar[<*>] x, ichar[<*>] y)macro bool[<*>] ichar[<*>].comp_ge(ichar[<*>] x, ichar[<*>] y)macro bool[<*>] ichar[<*>].comp_ne(ichar[<*>] x, ichar[<*>] y)macro ichar ichar[<*>].sum(ichar[<*>] x)macro ichar ichar[<*>].product(ichar[<*>] x)macro ichar ichar[<*>].and(ichar[<*>] x)macro ichar ichar[<*>].or(ichar[<*>] x)macro ichar ichar[<*>].xor(ichar[<*>] x)macro ichar ichar[<*>].max(ichar[<*>] x)macro ichar ichar[<*>].min(ichar[<*>] x)macro ichar ichar[<*>].dot(ichar[<*>] x, ichar[<*>] y)macro bool[<*>] short[<*>].comp_lt(short[<*>] x, short[<*>] y)macro bool[<*>] short[<*>].comp_le(short[<*>] x, short[<*>] y)macro bool[<*>] short[<*>].comp_eq(short[<*>] x, short[<*>] y)macro bool[<*>] short[<*>].comp_gt(short[<*>] x, short[<*>] y)macro bool[<*>] short[<*>].comp_ge(short[<*>] x, short[<*>] y)macro bool[<*>] short[<*>].comp_ne(short[<*>] x, short[<*>] y)macro short short[<*>].sum(short[<*>] x)macro short short[<*>].product(short[<*>] x)macro short short[<*>].and(short[<*>] x)macro short short[<*>].or(short[<*>] x)macro short short[<*>].xor(short[<*>] x)macro short short[<*>].max(short[<*>] x)macro short short[<*>].min(short[<*>] x)macro short short[<*>].dot(short[<*>] x, short[<*>] y)macro bool[<*>] int[<*>].comp_lt(int[<*>] x, int[<*>] y)macro bool[<*>] int[<*>].comp_le(int[<*>] x, int[<*>] y)macro bool[<*>] int[<*>].comp_eq(int[<*>] x, int[<*>] y)macro bool[<*>] int[<*>].comp_gt(int[<*>] x, int[<*>] y)macro bool[<*>] int[<*>].comp_ge(int[<*>] x, int[<*>] y)macro bool[<*>] int[<*>].comp_ne(int[<*>] x, int[<*>] y)macro int int[<*>].sum(int[<*>] x)macro int int[<*>].product(int[<*>] x)macro int int[<*>].and(int[<*>] x)macro int int[<*>].or(int[<*>] x)macro int int[<*>].xor(int[<*>] x)macro int int[<*>].max(int[<*>] x)macro int int[<*>].min(int[<*>] x)macro int int[<*>].dot(int[<*>] x, int[<*>] y)macro bool[<*>] long[<*>].comp_lt(long[<*>] x, long[<*>] y)macro bool[<*>] long[<*>].comp_le(long[<*>] x, long[<*>] y)macro bool[<*>] long[<*>].comp_eq(long[<*>] x, long[<*>] y)macro bool[<*>] long[<*>].comp_gt(long[<*>] x, long[<*>] y)macro bool[<*>] long[<*>].comp_ge(long[<*>] x, long[<*>] y)macro bool[<*>] long[<*>].comp_ne(long[<*>] x, long[<*>] y)macro long long[<*>].sum(long[<*>] x)macro long long[<*>].product(long[<*>] x)macro long long[<*>].and(long[<*>] x)macro long long[<*>].or(long[<*>] x)macro long long[<*>].xor(long[<*>] x)macro long long[<*>].max(long[<*>] x)macro long long[<*>].min(long[<*>] x)macro long long[<*>].dot(long[<*>] x, long[<*>] y)macro bool[<*>] int128[<*>].comp_lt(int128[<*>] x, int128[<*>] y)macro bool[<*>] int128[<*>].comp_le(int128[<*>] x, int128[<*>] y)macro bool[<*>] int128[<*>].comp_eq(int128[<*>] x, int128[<*>] y)macro bool[<*>] int128[<*>].comp_gt(int128[<*>] x, int128[<*>] y)macro bool[<*>] int128[<*>].comp_ge(int128[<*>] x, int128[<*>] y)macro bool[<*>] int128[<*>].comp_ne(int128[<*>] x, int128[<*>] y)macro int128 int128[<*>].sum(int128[<*>] x)macro int128 int128[<*>].product(int128[<*>] x)macro int128 int128[<*>].and(int128[<*>] x)macro int128 int128[<*>].or(int128[<*>] x)macro int128 int128[<*>].xor(int128[<*>] x)macro int128 int128[<*>].max(int128[<*>] x)macro int128 int128[<*>].min(int128[<*>] x)macro int128 int128[<*>].dot(int128[<*>] x, int128[<*>] y)macro bool[<*>] bool[<*>].comp_lt(bool[<*>] x, bool[<*>] y)macro bool[<*>] bool[<*>].comp_le(bool[<*>] x, bool[<*>] y)macro bool[<*>] bool[<*>].comp_eq(bool[<*>] x, bool[<*>] y)macro bool[<*>] bool[<*>].comp_gt(bool[<*>] x, bool[<*>] y)macro bool[<*>] bool[<*>].comp_ge(bool[<*>] x, bool[<*>] y)macro bool[<*>] bool[<*>].comp_ne(bool[<*>] x, bool[<*>] y)macro bool bool[<*>].sum(bool[<*>] x)macro bool bool[<*>].product(bool[<*>] x)macro bool bool[<*>].and(bool[<*>] x)macro bool bool[<*>].or(bool[<*>] x)macro bool bool[<*>].xor(bool[<*>] x)macro bool bool[<*>].max(bool[<*>] x)macro bool bool[<*>].min(bool[<*>] x)macro bool[<*>] char[<*>].comp_lt(char[<*>] x, char[<*>] y)macro bool[<*>] char[<*>].comp_le(char[<*>] x, char[<*>] y)macro bool[<*>] char[<*>].comp_eq(char[<*>] x, char[<*>] y)macro bool[<*>] char[<*>].comp_gt(char[<*>] x, char[<*>] y)macro bool[<*>] char[<*>].comp_ge(char[<*>] x, char[<*>] y)macro bool[<*>] char[<*>].comp_ne(char[<*>] x, char[<*>] y)macro char char[<*>].sum(char[<*>] x)macro char char[<*>].product(char[<*>] x)macro char char[<*>].and(char[<*>] x)macro char char[<*>].or(char[<*>] x)macro char char[<*>].xor(char[<*>] x)macro char char[<*>].max(char[<*>] x)macro char char[<*>].min(char[<*>] x)macro char char[<*>].dot(char[<*>] x, char[<*>] y)macro bool[<*>] ushort[<*>].comp_lt(ushort[<*>] x, ushort[<*>] y)macro bool[<*>] ushort[<*>].comp_le(ushort[<*>] x, ushort[<*>] y)macro bool[<*>] ushort[<*>].comp_eq(ushort[<*>] x, ushort[<*>] y)macro bool[<*>] ushort[<*>].comp_gt(ushort[<*>] x, ushort[<*>] y)macro bool[<*>] ushort[<*>].comp_ge(ushort[<*>] x, ushort[<*>] y)macro bool[<*>] ushort[<*>].comp_ne(ushort[<*>] x, ushort[<*>] y)macro ushort ushort[<*>].sum(ushort[<*>] x)macro ushort ushort[<*>].product(ushort[<*>] x)macro ushort ushort[<*>].and(ushort[<*>] x)macro ushort ushort[<*>].or(ushort[<*>] x)macro ushort ushort[<*>].xor(ushort[<*>] x)macro ushort ushort[<*>].max(ushort[<*>] x)macro ushort ushort[<*>].min(ushort[<*>] x)macro ushort ushort[<*>].dot(ushort[<*>] x, ushort[<*>] y)macro bool[<*>] uint[<*>].comp_lt(uint[<*>] x, uint[<*>] y)macro bool[<*>] uint[<*>].comp_le(uint[<*>] x, uint[<*>] y)macro bool[<*>] uint[<*>].comp_eq(uint[<*>] x, uint[<*>] y)macro bool[<*>] uint[<*>].comp_gt(uint[<*>] x, uint[<*>] y)macro bool[<*>] uint[<*>].comp_ge(uint[<*>] x, uint[<*>] y)macro bool[<*>] uint[<*>].comp_ne(uint[<*>] x, uint[<*>] y)macro uint uint[<*>].sum(uint[<*>] x)macro uint uint[<*>].product(uint[<*>] x)macro uint uint[<*>].and(uint[<*>] x)macro uint uint[<*>].or(uint[<*>] x)macro uint uint[<*>].xor(uint[<*>] x)macro uint uint[<*>].max(uint[<*>] x)macro uint uint[<*>].min(uint[<*>] x)macro uint uint[<*>].dot(uint[<*>] x, uint[<*>] y)macro bool[<*>] ulong[<*>].comp_lt(ulong[<*>] x, ulong[<*>] y)macro bool[<*>] ulong[<*>].comp_le(ulong[<*>] x, ulong[<*>] y)macro bool[<*>] ulong[<*>].comp_eq(ulong[<*>] x, ulong[<*>] y)macro bool[<*>] ulong[<*>].comp_gt(ulong[<*>] x, ulong[<*>] y)macro bool[<*>] ulong[<*>].comp_ge(ulong[<*>] x, ulong[<*>] y)macro bool[<*>] ulong[<*>].comp_ne(ulong[<*>] x, ulong[<*>] y)macro ulong ulong[<*>].sum(ulong[<*>] x)macro ulong ulong[<*>].product(ulong[<*>] x)macro ulong ulong[<*>].and(ulong[<*>] x)macro ulong ulong[<*>].or(ulong[<*>] x)macro ulong ulong[<*>].xor(ulong[<*>] x)macro ulong ulong[<*>].max(ulong[<*>] x)macro ulong ulong[<*>].min(ulong[<*>] x)macro ulong ulong[<*>].dot(ulong[<*>] x, ulong[<*>] y)macro bool[<*>] uint128[<*>].comp_lt(uint128[<*>] x, uint128[<*>] y)macro bool[<*>] uint128[<*>].comp_le(uint128[<*>] x, uint128[<*>] y)macro bool[<*>] uint128[<*>].comp_eq(uint128[<*>] x, uint128[<*>] y)macro bool[<*>] uint128[<*>].comp_gt(uint128[<*>] x, uint128[<*>] y)macro bool[<*>] uint128[<*>].comp_ge(uint128[<*>] x, uint128[<*>] y)macro bool[<*>] uint128[<*>].comp_ne(uint128[<*>] x, uint128[<*>] y)macro uint128 uint128[<*>].sum(uint128[<*>] x)macro uint128 uint128[<*>].product(uint128[<*>] x)macro uint128 uint128[<*>].and(uint128[<*>] x)macro uint128 uint128[<*>].or(uint128[<*>] x)macro uint128 uint128[<*>].xor(uint128[<*>] x)macro uint128 uint128[<*>].max(uint128[<*>] x)macro uint128 uint128[<*>].min(uint128[<*>] x)macro uint128 uint128[<*>].dot(uint128[<*>] x, uint128[<*>] y)macro char char.sat_add(char x, char y)macro char char.sat_sub(char x, char y)macro char char.sat_mul(char x, char y)macro char char.sat_shl(char x, char y)macro char? char.overflow_add(char x, char y)macro char? char.overflow_sub(char x, char y)macro char? char.overflow_mul(char x, char y)macro ichar ichar.sat_add(ichar x, ichar y)macro ichar ichar.sat_sub(ichar x, ichar y)macro ichar ichar.sat_mul(ichar x, ichar y)macro ichar ichar.sat_shl(ichar x, ichar y)macro ichar? ichar.overflow_add(ichar x, ichar y)macro ichar? ichar.overflow_sub(ichar x, ichar y)macro ichar? ichar.overflow_mul(ichar x, ichar y)macro ushort ushort.sat_add(ushort x, ushort y)macro ushort ushort.sat_sub(ushort x, ushort y)macro ushort ushort.sat_mul(ushort x, ushort y)macro ushort ushort.sat_shl(ushort x, ushort y)macro ushort? ushort.overflow_add(ushort x, ushort y)macro ushort? ushort.overflow_sub(ushort x, ushort y)macro ushort? ushort.overflow_mul(ushort x, ushort y)macro short short.sat_add(short x, short y)macro short short.sat_sub(short x, short y)macro short short.sat_mul(short x, short y)macro short short.sat_shl(short x, short y)macro short? short.overflow_add(short x, short y)macro short? short.overflow_sub(short x, short y)macro short? short.overflow_mul(short x, short y)macro uint uint.sat_add(uint x, uint y)macro uint uint.sat_sub(uint x, uint y)macro uint uint.sat_mul(uint x, uint y)macro uint uint.sat_shl(uint x, uint y)macro uint? uint.overflow_add(uint x, uint y)macro uint? uint.overflow_sub(uint x, uint y)macro uint? uint.overflow_mul(uint x, uint y)macro int int.sat_add(int x, int y)macro int int.sat_sub(int x, int y)macro int int.sat_mul(int x, int y)macro int int.sat_shl(int x, int y)macro int? int.overflow_add(int x, int y)macro int? int.overflow_sub(int x, int y)macro int? int.overflow_mul(int x, int y)macro ulong ulong.sat_add(ulong x, ulong y)macro ulong ulong.sat_sub(ulong x, ulong y)macro ulong ulong.sat_mul(ulong x, ulong y)macro ulong ulong.sat_shl(ulong x, ulong y)macro ulong? ulong.overflow_add(ulong x, ulong y)macro ulong? ulong.overflow_sub(ulong x, ulong y)macro ulong? ulong.overflow_mul(ulong x, ulong y)macro long long.sat_add(long x, long y)macro long long.sat_sub(long x, long y)macro long long.sat_mul(long x, long y)macro long long.sat_shl(long x, long y)macro long? long.overflow_add(long x, long y)macro long? long.overflow_sub(long x, long y)macro long? long.overflow_mul(long x, long y)macro uint128 uint128.sat_add(uint128 x, uint128 y)macro uint128 uint128.sat_sub(uint128 x, uint128 y)macro uint128 uint128.sat_mul(uint128 x, uint128 y)macro uint128 uint128.sat_shl(uint128 x, uint128 y)macro uint128? uint128.overflow_add(uint128 x, uint128 y)macro uint128? uint128.overflow_sub(uint128 x, uint128 y)macro uint128? uint128.overflow_mul(uint128 x, uint128 y)macro int128 int128.sat_add(int128 x, int128 y)macro int128 int128.sat_sub(int128 x, int128 y)macro int128 int128.sat_mul(int128 x, int128 y)macro int128 int128.sat_shl(int128 x, int128 y)macro int128? int128.overflow_add(int128 x, int128 y)macro int128? int128.overflow_sub(int128 x, int128 y)macro int128? int128.overflow_mul(int128 x, int128 y)macro bool is_odd(x)macro bool is_even(x)macro bool char.is_even(char x)macro bool char.is_odd(char x)macro bool ichar.is_even(ichar x)macro bool ichar.is_odd(ichar x)macro bool ushort.is_even(ushort x)macro bool ushort.is_odd(ushort x)macro bool short.is_even(short x)macro bool short.is_odd(short x)macro bool uint.is_even(uint x)macro bool uint.is_odd(uint x)macro bool int.is_even(int x)macro bool int.is_odd(int x)macro bool ulong.is_even(ulong x)macro bool ulong.is_odd(ulong x)macro bool long.is_even(long x)macro bool long.is_odd(long x)macro bool uint128.is_even(uint128 x)macro bool uint128.is_odd(uint128 x)macro bool int128.is_even(int128 x)macro bool int128.is_odd(int128 x)macro bool is_power_of_2(x)macro next_power_of_2(x)macro uint double.high_word(double d)macro uint double.low_word(double d)macro uint float.word(float d)macro void double.set_high_word(double* d, uint u)macro void double.set_low_word(double* d, uint u)macro void float.set_word(float* f, uint u)macro double scalbn(double x, int n)extern fn double _atan(double x) @MathLibc("atan")fn void _sincosf(float a, float* s, float* c) @extern("sincosf") @if(env::WIN32)extern fn double _tan(double x) @MathLibc("tan")fn float _frexpf(float x, int* e)macro bool overflow_add(a, b, out)macro bool overflow_sub(a, b, out)macro bool overflow_mul(a, b, out)macro iota($Type)macro char char.muldiv(self, char mul, char div)macro ichar ichar.muldiv(self, ichar mul, ichar div)macro short short.muldiv(self, short mul, short div)macro ushort ushort.muldiv(self, ushort mul, ushort div)macro int int.muldiv(self, int mul, int div)macro uint uint.muldiv(self, uint mul, uint div)macro long long.muldiv(self, long mul, long div)macro ulong ulong.muldiv(self, ulong mul, ulong div)macro char[<*>] char[<*>].muldiv(self, mul, div)macro ichar[<*>] ichar[<*>].muldiv(self, mul, div)macro short[<*>] short[<*>].muldiv(self, mul, div)macro ushort[<*>] ushort[<*>].muldiv(self, mul, div)macro int[<*>] int[<*>].muldiv(self, mul, div)macro uint[<*>] uint[<*>].muldiv(self, mul, div)macro long[<*>] long[<*>].muldiv(self, mul, div)macro ulong[<*>] ulong[<*>].muldiv(self, mul, div)macro lcm(...)macro gcd(...)alias Matrix2f = Matrix2x2 {float}alias Matrix2 = Matrix2x2 {double}alias Matrix3f = Matrix3x3 {float}alias Matrix3 = Matrix3x3 {double}alias Matrix4f = Matrix4x4 {float}alias Matrix4 = Matrix4x4 {double}alias matrix4_ortho @builtin = matrix::ortho {double}alias matrix4f_ortho @builtin = matrix::ortho {float}alias matrix4_perspective @builtin = matrix::perspective {double}alias matrix4f_perspective @builtin = matrix::perspective {float}alias MATRIX2_IDENTITY @builtin = matrix::IDENTITY2 {double}alias MATRIX2F_IDENTITY @builtin = matrix::IDENTITY2 {float}alias MATRIX3_IDENTITY @builtin = matrix::IDENTITY3 {double}alias MATRIX3F_IDENTITY @builtin = matrix::IDENTITY3 {float}alias MATRIX4_IDENTITY @builtin = matrix::IDENTITY4 {double}alias MATRIX4F_IDENTITY @builtin = matrix::IDENTITY4 {float}alias Quaternionf = Quaternion {float}alias Quaternion = Quaternion {double}alias QUATERNION_IDENTITY @builtin = quaternion::IDENTITY {double}alias QUATERNIONF_IDENTITY @builtin = quaternion::IDENTITY {float}std::math::bigint
Section titled “std::math::bigint”struct BigInt (Printable)fn BigInt from_int(int128 val)fn BigInt* BigInt.init(&self, int128 value)fn BigInt* BigInt.init_with_u128(&self, uint128 value)fn BigInt* BigInt.init_with_array(&self, uint[] values)fn BigInt*? BigInt.init_string_radix(&self, String value, int radix)fn bool BigInt.is_negative(&self)fn BigInt BigInt.add(self, BigInt other) @operator(+)fn void BigInt.add_this(&self, BigInt other) @operator(+=)macro uint find_length(uint* data, uint length)fn BigInt BigInt.mult(self, BigInt bi2) @operator(*)fn void BigInt.mult_this(&self, BigInt bi2) @operator(*=)fn void BigInt.negate(&self)macro bool BigInt.is_zero(&self)fn BigInt BigInt.sub(self, BigInt other) @operator(-)fn BigInt* BigInt.sub_this(&self, BigInt other) @operator(-=)fn int BigInt.bitcount(&self)fn BigInt BigInt.unary_minus(&self) @operator(-)macro BigInt BigInt.div(self, BigInt other) @operator(/)fn void BigInt.div_this(&self, BigInt other) @operator(/=)fn BigInt BigInt.mod(self, BigInt bi2) @operator(%)fn void BigInt.mod_this(&self, BigInt bi2) @operator(%=)fn void BigInt.bit_negate_this(&self)fn BigInt BigInt.bit_negate(self) @operator(~)fn BigInt BigInt.shr(self, int shift) @operator(>>)fn void BigInt.shr_this(self, int shift) @operator(>>=)fn BigInt BigInt.shl(self, int shift) @operator(<<)macro bool BigInt.equals(&self, BigInt other) @operator(==)macro bool BigInt.greater_than(&self, BigInt other)macro bool BigInt.less_than(&self, BigInt other)fn bool BigInt.is_odd(&self)fn bool BigInt.is_one(&self)macro bool BigInt.greater_or_equal(&self, BigInt other)macro bool BigInt.less_or_equal(&self, BigInt)fn BigInt BigInt.abs(&self)fn usz? BigInt.to_format(&self, Formatter* format) @dynamicfn String BigInt.to_string(&self, Allocator allocator) @dynamicfn String BigInt.to_string_with_radix(&self, int radix, Allocator allocator)fn BigInt BigInt.mod_pow(&self, BigInt exp, BigInt mod)fn BigInt barrett_reduction(BigInt x, BigInt n, BigInt constant)fn BigInt BigInt.sqrt(&self)fn BigInt BigInt.bit_and(self, BigInt bi2) @operator(&)fn void BigInt.bit_and_this(&self, BigInt bi2)fn BigInt BigInt.bit_or(self, BigInt bi2) @operator(|)fn void BigInt.bit_or_this(&self, BigInt bi2)fn BigInt BigInt.bit_xor(self, BigInt bi2) @operator(^)fn void BigInt.bit_xor_this(&self, BigInt bi2)fn void BigInt.shl_this(&self, int shift) @operator(<<=)fn BigInt BigInt.gcd(&self, BigInt other)fn BigInt BigInt.lcm(&self, BigInt other)fn void BigInt.randomize_bits(&self, Random random, int bits)std::math::complex {Real}
Section titled “std::math::complex {Real}”macro Complex Complex.add(self, Complex b) @operator(+)macro Complex Complex.add_this(&self, Complex b) @operator(+=)macro Complex Complex.add_real(self, Real r) @operator_s(+)macro Complex Complex.add_each(self, Real b)macro Complex Complex.sub(self, Complex b) @operator(-)macro Complex Complex.sub_this(&self, Complex b) @operator(-=)macro Complex Complex.sub_real(self, Real r) @operator(-)macro Complex Complex.sub_real_inverse(self, Real r) @operator_r(-)macro Complex Complex.sub_each(self, Real b)macro Complex Complex.scale(self, Real r) @operator_s(*)macro Complex Complex.mul(self, Complex b)@operator(*)macro Complex Complex.div_real(self, Real r) @operator(/)macro Complex Complex.div_real_inverse(Complex c, Real r) @operator_r(/)macro Complex Complex.div(self, Complex b) @operator(/)macro Complex Complex.inverse(self)macro Complex Complex.conjugate(self)macro Complex Complex.negate(self) @operator(-)macro bool Complex.equals(self, Complex b) @operator(==)macro bool Complex.equals_real(self, Real r) @operator_s(==)macro bool Complex.not_equals(self, Complex b) @operator(!=)fn usz? Complex.to_format(&self, Formatter* f) @dynamicstd::math::easing
Section titled “std::math::easing”fn float linear_none(float t, float b, float c, float d) @inlinefn float linear_in(float t, float b, float c, float d) @inlinefn float linear_out(float t, float b, float c, float d) @inlinefn float linear_inout(float t, float b, float c, float d) @inlinefn float sine_in(float t, float b, float c, float d) @inlinefn float sine_out(float t, float b, float c, float d) @inlinefn float sine_inout(float t, float b, float c, float d) @inlinefn float circ_in(float t, float b, float c, float d) @inlinefn float circ_out(float t, float b, float c, float d) @inlinefn float circ_inout(float t, float b, float c, float d) @inlinefn float cubic_in(float t, float b, float c, float d) @inlinefn float cubic_out(float t, float b, float c, float d) @inlinefn float cubic_inout(float t, float b, float c, float d) @inlinefn float quad_in(float t, float b, float c, float d) @inlinefn float quad_out(float t, float b, float c, float d) @inlinefn float quad_inout(float t, float b, float c, float d) @inlinefn float expo_in(float t, float b, float c, float d) @inlinefn float expo_out(float t, float b, float c, float d) @inlinefn float expo_inout(float t, float b, float c, float d) @inlinefn float back_in(float t, float b, float c, float d, float s = 1.70158f) @inlinefn float back_out(float t, float b, float c, float d, float s = 1.70158f) @inlinefn float back_inout(float t, float b, float c, float d, float s = 1.70158f) @inlinefn float bounce_out(float t, float b, float c, float d) @inlinefn float bounce_in(float t, float b, float c, float d) @inlinefn float bounce_inout(float t, float b, float c, float d) @inlinefn float elastic_in(float t, float b, float c, float d) @inlinefn float elastic_out(float t, float b, float c, float d) @inlinefn float elastic_inout(float t, float b, float c, float d) @inlinestd::math::math_rt
Section titled “std::math::math_rt”fn int128 __divti3(int128 a, int128 b) @extern("__divti3") @weak @nostripmacro uint128 @__udivmodti4(uint128 a, uint128 b, bool $return_rem)fn uint128 __umodti3(uint128 n, uint128 d) @extern("__umodti3") @weak @nostripfn uint128 __udivti3(uint128 n, uint128 d) @extern("__udivti3") @weak @nostripfn int128 __modti3(int128 a, int128 b) @extern("__modti3") @weak @nostripfn uint128 __lshrti3(uint128 a, uint b) @extern("__lshrti3") @weak @nostripfn int128 __ashrti3(int128 a, uint b) @extern("__ashrti3") @weak @nostripfn int128 __ashlti3(int128 a, uint b) @extern("__ashlti3") @weak @nostripfn int128 __multi3(int128 a, int128 b) @extern("__multi3") @weak @nostripfn float __floattisf(int128 a) @extern("__floattisf") @weak @nostripfn double __floattidf(int128 a) @extern("__floattidf") @weak @nostripfn float __floatuntisf(uint128 a) @extern("__floatuntisf") @weak @nostripfn double __floatuntidf(uint128 a) @extern("__floatuntidf") @weak @nostripfn uint128 __fixunsdfti(double a) @weak @extern("__fixunsdfti") @nostripfn uint128 __fixunssfti(float a) @weak @extern("__fixunssfti") @nostripfn int128 __fixdfti(double a) @weak @extern("__fixdfti") @nostripfn int128 __fixsfti(float a) @weak @extern("__fixsfti") @nostripfn float __roundevenf(float f) @extern("roundevenf") @weak @nostripfn double __roundeven(double d) @extern("roundeven") @weak @nostripfn double __powidf2(double a, int b) @extern("__powidf2") @weak @nostripstd::math::matrix {Real}
Section titled “std::math::matrix {Real}”struct Matrix2x2struct Matrix3x3struct Matrix4x4fn Real[<2>] Matrix2x2.apply(&self, Real[<2>] vec) @operator(*)fn Real[<3>] Matrix3x3.apply(&self, Real[<3>] vec) @operator(*)fn Real[<4>] Matrix4x4.apply(&self, Real[<4>] vec) @operator(*)fn Matrix2x2 Matrix2x2.mul(&self, Matrix2x2 b) @operator(*)fn Matrix3x3 Matrix3x3.mul(&self, Matrix3x3 b) @operator(*)fn Matrix4x4 Matrix4x4.mul(Matrix4x4* self, Matrix4x4 b) @operator(*)fn Matrix2x2 Matrix2x2.component_mul(&self, Real s)fn Matrix3x3 Matrix3x3.component_mul(&self, Real s)fn Matrix4x4 Matrix4x4.component_mul(&self, Real s)fn Matrix2x2 Matrix2x2.add(&self, Matrix2x2 mat2) @operator(+)fn Matrix3x3 Matrix3x3.add(&self, Matrix3x3 mat2) @operator(+)fn Matrix4x4 Matrix4x4.add(&self, Matrix4x4 mat2) @operator(+)fn Matrix2x2 Matrix2x2.sub(&self, Matrix2x2 mat2) @operator(-)fn Matrix3x3 Matrix3x3.sub(&self, Matrix3x3 mat2) @operator(-)fn Matrix4x4 Matrix4x4.sub(&self, Matrix4x4 mat2) @operator(-)fn Matrix2x2 Matrix2x2.negate(&self) @operator(-)fn Matrix3x3 Matrix3x3.negate(&self) @operator(-)fn Matrix4x4 Matrix4x4.negate(&self) @operator(-)fn bool Matrix2x2.eq(&self, Matrix2x2 mat2) @operator(==)fn bool Matrix3x3.eq(&self, Matrix3x3 mat2) @operator(==)fn bool Matrix4x4.eq(&self, Matrix4x4 mat2) @operator(==)fn bool Matrix2x2.neq(&self, Matrix2x2 mat2) @operator(!=)fn bool Matrix3x3.neq(&self, Matrix3x3 mat2) @operator(!=)fn bool Matrix4x4.neq(&self, Matrix4x4 mat2) @operator(!=)fn Matrix4x4 look_at(Real[<3>] eye, Real[<3>] target, Real[<3>] up)fn Matrix2x2 Matrix2x2.transpose(&self)fn Matrix3x3 Matrix3x3.transpose(&self)fn Matrix4x4 Matrix4x4.transpose(&self)fn Real Matrix2x2.determinant(&self)fn Real Matrix3x3.determinant(&self)fn Real Matrix4x4.determinant(&self)fn Matrix2x2 Matrix2x2.adjoint(&self)fn Matrix3x3 Matrix3x3.adjoint(&self)fn Matrix4x4 Matrix4x4.adjoint(&self)fn Matrix2x2? Matrix2x2.inverse(&self)fn Matrix3x3? Matrix3x3.inverse(&self)fn Matrix4x4? Matrix4x4.inverse(&self)fn Matrix3x3 Matrix3x3.translate(&self, Real[<2>] v)fn Matrix4x4 Matrix4x4.translate(&self, Real[<3>] v)fn Matrix3x3 Matrix3x3.rotate(&self, Real r)fn Matrix4x4 Matrix4x4.rotate_z(&self, Real r)fn Matrix4x4 Matrix4x4.rotate_y(&self, Real r)fn Matrix4x4 Matrix4x4.rotate_x(&self, Real r)fn Matrix3x3 Matrix3x3.scale(&self, Real[<2>] v)fn Real Matrix2x2.trace(&self)fn Real Matrix3x3.trace(&self)fn Real Matrix4x4.trace(&self)fn Matrix4x4 Matrix4x4.scale(&self, Real[<3>] v)fn Matrix4x4 ortho(Real left, Real right, Real top, Real bottom, Real near, Real far)fn Matrix4x4 perspective(Real fov, Real aspect_ratio, Real near, Real far)std::math::nolibc @if(env::NO_LIBC || $feature(C3_MATH))
Section titled “std::math::nolibc @if(env::NO_LIBC || $feature(C3_MATH))”fn double __cos(double x, double y) @extern("__cos") @weak @nostripfn float __cosdf(double x) @extern("__cosdf") @weak @nostripfn double fmod(double x, double y) @extern("fmod") @weak @nostripfn float fmodf(float x, float y) @extern("fmodf") @weak @nostripfn double __sin(double x, double y, int iy) @extern("__sin") @weak @nostripfn float __sindf(double x) @extern("__sindf") @weak @nostripfn double __tan(double x, double y, int odd) @extern("__tan") @weak @nostripfn float __tandf(double x, int odd) @extern("__tandf") @weak @nostripfn double _acos(double x) @weak @extern("acos") @nostripfn float _acosf(float x) @weak @extern("acosf") @nostripfn double _asin(double x) @weak @extern("asin") @nostripfn float _asinf(float x) @weak @extern("asinf") @nostripfn double _atan(double x) @weak @extern("atan") @nostripfn float _atanf(float x) @weak @extern("atanf") @nostripfn double _atan2(double y, double x) @weak @extern("atan2") @nostripfn float _atan2f(float y, float x) @weak @extern("atan2f") @nostripfn double _atanh(double x) @weak @extern("atanh") @nostripfn float _atanhf(float x) @weak @extern("atanhf") @nostripfn double _ceil(double x) @weak @extern("ceil") @nostripfn float _ceilf(float x) @weak @extern("ceilf") @nostripfn float _cosf(float x) @extern("cosf") @weak @nostripfn double _cos(double x) @extern("cos") @weak @nostripfn double exp(double x) @extern("exp")fn float expf(float x) @extern("expf")fn float _exp2f(float x) @extern("exp2f") @weak @nostripfn double _exp2(double x) @extern("exp2") @weak @nostripfn double _fabs(double x) @weak @extern("fabs") @nostripfn float _fabsf(float x) @weak @extern("fabsf") @nostripfn double _floor(double x) @weak @extern("floor") @nostripfn float _floorf(float x) @weak @extern("floorf") @nostripfn double frexp(double x, int* exp) @extern("frexp")fn float frexpf(float x, int* exp) @extern("frexpf")fn double ldexp(double x, int exp) @extern("ldexp")fn float ldexpf(float x, int exp) @extern("ldexpf")fn double log(double x) @extern("log")fn float logf(float x) @extern("logf")fn double _log1p(double x) @weak @extern("log1p") @nostripfn float _log1pf(float x) @weak @extern("log1pf") @nostripmacro float __math_uflowf(uint sign)macro double __math_uflow(ulong sign)macro float __math_oflowf(uint sign)macro double __math_oflow(ulong sign)macro __math_xflow(sign, v)macro force_eval_add(x, v)fn double pow(double x, double y) @extern("pow")fn float powf(float x, float y) @extern("powf")fn int __rem_pio2f(float x, double *y)fn int __rem_pio2_large(double* x, double* y, int e0, int nx, int prec)fn int __rem_pio2(double x, double *y)fn double _round(double x) @extern("round") @weak @nostripfn float _roundf(float x) @extern("roundf") @weak @nostripfn double _scalbn(double x, int n) @weak @extern("scalbn") @nostripfn float _sinf(float x) @weak @extern("sinf") @nostripfn double sin(double x) @extern("sin") @weak @nostripfn void sincosf(float x, float *sin, float *cos) @extern("__sincosf") @weak @nostripfn void sincos(double x, double *sin, double *cos) @extern("__sincos") @weak @nostripfn double tan(double x) @extern("tan") @weak @nostripfn float tanf(float x) @extern("tanf") @weak @nostripfn double sincos_broken(double x) @extern("sincos") @weak @nostripfn double _trunc(double x) @weak @extern("trunc") @nostripfn float _truncf(float x) @weak @extern("truncf") @nostripstd::math::quaternion {Real}
Section titled “std::math::quaternion {Real}”macro Quaternion Quaternion.add(self, Quaternion b) @operator(+)macro Quaternion Quaternion.add_each(self, Real b)macro Quaternion Quaternion.sub(self, Quaternion b) @operator(-)macro Quaternion Quaternion.negate(self) @operator(-)macro Quaternion Quaternion.sub_each(self, Real b)macro Quaternion Quaternion.scale(self, Real s) @operator_s(*)macro Quaternion Quaternion.normalize(self)macro Real Quaternion.length(self)macro Quaternion Quaternion.lerp(self, Quaternion q2, Real amount)macro Matrix4f Quaternion.to_matrixf(&self)macro Matrix4 Quaternion.to_matrix(&self)fn Quaternion Quaternion.nlerp(self, Quaternion q2, Real amount)fn Quaternion Quaternion.invert(self)fn Quaternion Quaternion.slerp(self, Quaternion q2, Real amount)fn Quaternion Quaternion.mul(self, Quaternion b) @operator(*)std::math::random
Section titled “std::math::random”macro void seed(random, seed)macro void seed_entropy(random)macro int next(random, uint range)macro int next_in_range(random, int min, int max)alias DefaultRandom = Sfc64Randomfn void srand(ulong seed) @builtinfn int rand(int range) @builtinfn int rand_in_range(int min, int max) @builtinfn double rnd() @builtinmacro bool next_bool(random)macro float next_float(random)macro double next_double(random)macro bool is_random(random)macro uint128 @long_to_int128(#function)macro ulong @int_to_long(#function)macro uint @short_to_int(#function)macro ushort @char_to_short(#function)macro @random_value_to_bytes(#function, char[] bytes)typedef Lcg128Random (Random) = uint128fn void Lcg128Random.set_seed(&self, char[] input) @dynamicfn ulong Lcg128Random.next_long(&self) @dynamicfn void Lcg128Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Lcg128Random.next_int128(&self) @dynamicfn uint Lcg128Random.next_int(&self) @dynamicfn ushort Lcg128Random.next_short(&self) @dynamicfn char Lcg128Random.next_byte(&self) @dynamictypedef Lcg64Random (Random) = ulongfn void Lcg64Random.set_seed(&self, char[] seed) @dynamicfn uint Lcg64Random.next_int(&self) @dynamicfn void Lcg64Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Lcg64Random.next_int128(&self) @dynamicfn ulong Lcg64Random.next_long(&self) @dynamicfn ushort Lcg64Random.next_short(&self) @dynamicfn char Lcg64Random.next_byte(&self) @dynamictypedef Lcg32Random (Random) = uintfn void Lcg32Random.set_seed(&self, char[] seed) @dynamicfn ushort Lcg32Random.next_short(&self) @dynamicfn void Lcg32Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Lcg32Random.next_int128(&self) @dynamicfn ulong Lcg32Random.next_long(&self) @dynamicfn uint Lcg32Random.next_int(&self) @dynamicfn char Lcg32Random.next_byte(&self) @dynamictypedef Lcg16Random (Random) = ushortfn void Lcg16Random.set_seed(&self, char[] seed) @dynamicfn char Lcg16Random.next_byte(&self) @dynamicfn void Lcg16Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Lcg16Random.next_int128(&self) @dynamicfn ulong Lcg16Random.next_long(&self) @dynamicfn uint Lcg16Random.next_int(&self) @dynamicfn ushort Lcg16Random.next_short(&self) @dynamictypedef Mcg128Random (Random) = uint128fn void Mcg128Random.set_seed(&self, char[] seed) @dynamicfn void Mcg128Random.next_bytes(&self, char[] bytes) @dynamicfn ulong Mcg128Random.next_long(&self) @dynamicfn uint128 Mcg128Random.next_int128(&self) @dynamicfn uint Mcg128Random.next_int(&self) @dynamicfn ushort Mcg128Random.next_short(&self) @dynamicfn char Mcg128Random.next_byte(&self) @dynamictypedef Mcg64Random (Random) = ulongfn void Mcg64Random.set_seed(&self, char[] seed) @dynamicfn void Mcg64Random.next_bytes(&self, char[] bytes) @dynamicfn uint Mcg64Random.next_int(&self) @dynamicfn uint128 Mcg64Random.next_int128(&self) @dynamicfn ulong Mcg64Random.next_long(&self) @dynamicfn ushort Mcg64Random.next_short(&self) @dynamicfn char Mcg64Random.next_byte(&self) @dynamictypedef Mcg32Random (Random) = uintfn void Mcg32Random.set_seed(&self, char[] seed) @dynamicfn ushort Mcg32Random.next_short(&self) @dynamicfn void Mcg32Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Mcg32Random.next_int128(&self) @dynamicfn ulong Mcg32Random.next_long(&self) @dynamicfn uint Mcg32Random.next_int(&self) @dynamicfn char Mcg32Random.next_byte(&self) @dynamictypedef Mcg16Random (Random) = ushortfn void Mcg16Random.set_seed(&self, char[] seed) @dynamicfn char Mcg16Random.next_byte(&self) @dynamicfn void Mcg16Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Mcg16Random.next_int128(&self) @dynamicfn ulong Mcg16Random.next_long(&self) @dynamicfn uint Mcg16Random.next_int(&self) @dynamicfn ushort Mcg16Random.next_short(&self) @dynamicstruct Msws128Random (Random)fn void Msws128Random.set_seed(&self, char[] input) @dynamicfn uint128 Msws128Random.next_int128(&self) @dynamicfn void Msws128Random.next_bytes(&self, char[] bytes) @dynamicfn ulong Msws128Random.next_long(&self) @dynamicfn uint Msws128Random.next_int(&self) @dynamicfn ushort Msws128Random.next_short(&self) @dynamicfn char Msws128Random.next_byte(&self) @dynamicstruct Msws64Random (Random)fn void Msws64Random.set_seed(&self, char[] input) @dynamicfn ulong Msws64Random.next_long(&self) @dynamicfn void Msws64Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Msws64Random.next_int128(&self) @dynamicfn uint Msws64Random.next_int(&self) @dynamicfn ushort Msws64Random.next_short(&self) @dynamicfn char Msws64Random.next_byte(&self) @dynamicstruct Msws32Random (Random)fn void Msws32Random.set_seed(&self, char[] input) @dynamicfn uint Msws32Random.next_int(&self) @dynamicfn void Msws32Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Msws32Random.next_int128(&self) @dynamicfn ulong Msws32Random.next_long(&self) @dynamicfn ushort Msws32Random.next_short(&self) @dynamicfn char Msws32Random.next_byte(&self) @dynamicstruct Msws16Random (Random)fn void Msws16Random.set_seed(&self, char[] input) @dynamicfn ushort Msws16Random.next_short(&self) @dynamicfn void Msws16Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Msws16Random.next_int128(&self) @dynamicfn ulong Msws16Random.next_long(&self) @dynamicfn uint Msws16Random.next_int(&self) @dynamicfn char Msws16Random.next_byte(&self) @dynamicstruct Msws8Random (Random)fn void Msws8Random.set_seed(&self, char[] input) @dynamicfn char Msws8Random.next_byte(&self) @dynamicfn void Msws8Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Msws8Random.next_int128(&self) @dynamicfn ulong Msws8Random.next_long(&self) @dynamicfn uint Msws8Random.next_int(&self) @dynamicfn ushort Msws8Random.next_short(&self) @dynamictypedef Pcg128Random (Random) = uint128fn void Pcg128Random.set_seed(&self, char[] input) @dynamicfn ulong Pcg128Random.next_long(&self) @dynamicfn void Pcg128Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Pcg128Random.next_int128(&self) @dynamicfn uint Pcg128Random.next_int(&self) @dynamicfn ushort Pcg128Random.next_short(&self) @dynamicfn char Pcg128Random.next_byte(&self) @dynamictypedef Pcg64Random (Random) = ulongfn void Pcg64Random.set_seed(&self, char[] input) @dynamicfn uint Pcg64Random.next_int(&self) @dynamicfn void Pcg64Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Pcg64Random.next_int128(&self) @dynamicfn ulong Pcg64Random.next_long(&self) @dynamicfn ushort Pcg64Random.next_short(&self) @dynamicfn char Pcg64Random.next_byte(&self) @dynamictypedef Pcg32Random (Random) = uintfn void Pcg32Random.set_seed(&self, char[] input) @dynamicfn ushort Pcg32Random.next_short(&self) @dynamicfn void Pcg32Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Pcg32Random.next_int128(&self) @dynamicfn ulong Pcg32Random.next_long(&self) @dynamicfn uint Pcg32Random.next_int(&self) @dynamicfn char Pcg32Random.next_byte(&self) @dynamictypedef Pcg16Random (Random) = ushortfn void Pcg16Random.set_seed(&self, char[] input) @dynamicfn char Pcg16Random.next_byte(&self) @dynamicfn void Pcg16Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Pcg16Random.next_int128(&self) @dynamicfn ulong Pcg16Random.next_long(&self) @dynamicfn uint Pcg16Random.next_int(&self) @dynamicfn ushort Pcg16Random.next_short(&self) @dynamicfn void seeder(char[] input, char[] out_buffer)fn char[8 * 4] entropy() @if(!env::WASM_NOLIBC)fn char[8 * 4] entropy() @if(env::WASM_NOLIBC)typedef Sfc128Random (Random) = uint128[4]fn void Sfc128Random.set_seed(&self, char[] input) @dynamicfn uint128 Sfc128Random.next_int128(&self) @dynamicfn void Sfc128Random.next_bytes(&self, char[] bytes) @dynamicfn ulong Sfc128Random.next_long(&self) @dynamicfn uint Sfc128Random.next_int(&self) @dynamicfn ushort Sfc128Random.next_short(&self) @dynamicfn char Sfc128Random.next_byte(&self) @dynamictypedef Sfc64Random (Random) = ulong[4]fn void Sfc64Random.set_seed(&self, char[] input) @dynamicfn ulong Sfc64Random.next_long(&self) @dynamicfn void Sfc64Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Sfc64Random.next_int128(&self) @dynamicfn uint Sfc64Random.next_int(&self) @dynamicfn ushort Sfc64Random.next_short(&self) @dynamicfn char Sfc64Random.next_byte(&self) @dynamictypedef Sfc32Random (Random) = uint[4]fn void Sfc32Random.set_seed(&self, char[] input) @dynamicfn uint Sfc32Random.next_int(&sfc) @dynamicfn void Sfc32Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Sfc32Random.next_int128(&self) @dynamicfn ulong Sfc32Random.next_long(&self) @dynamicfn ushort Sfc32Random.next_short(&self) @dynamicfn char Sfc32Random.next_byte(&self) @dynamictypedef Sfc16Random (Random) = ushort[4]fn void Sfc16Random.set_seed(&self, char[] input) @dynamicfn ushort Sfc16Random.next_short(&seed) @dynamicfn void Sfc16Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Sfc16Random.next_int128(&self) @dynamicfn ulong Sfc16Random.next_long(&self) @dynamicfn uint Sfc16Random.next_int(&self) @dynamicfn char Sfc16Random.next_byte(&self) @dynamictypedef Sfc8Random (Random) = char[4]fn void Sfc8Random.set_seed(&self, char[] input) @dynamicfn char Sfc8Random.next_byte(&self) @dynamicfn void Sfc8Random.next_bytes(&self, char[] bytes) @dynamicfn uint128 Sfc8Random.next_int128(&self) @dynamicfn ulong Sfc8Random.next_long(&self) @dynamicfn uint Sfc8Random.next_int(&self) @dynamicfn ushort Sfc8Random.next_short(&self) @dynamictypedef SimpleRandom (Random) = ulongfn void SimpleRandom.set_seed(&self, char[] seed) @dynamicfn uint SimpleRandom.next_int(&self) @dynamicfn void SimpleRandom.next_bytes(&self, char[] bytes) @dynamicfn uint128 SimpleRandom.next_int128(&self) @dynamicfn ulong SimpleRandom.next_long(&self) @dynamicfn ushort SimpleRandom.next_short(&self) @dynamicfn char SimpleRandom.next_byte(&self) @dynamicstd::math::uuid
Section titled “std::math::uuid”typedef Uuid (Printable) = char[16]fn Uuid generate()fn Uuid generate_from_random(Random random)fn usz? Uuid.to_format(&self, Formatter* formatter) @dynamicfn String Uuid.to_string(&self, Allocator allocator)std::math::vector
Section titled “std::math::vector”macro double[<*>].sq_magnitude(self)macro float[<*>].sq_magnitude(self)macro double[<*>].distance_sq(self, double[<*>] v2)macro float[<*>].distance_sq(self, float[<*>] v2)macro float[<2>].transform(self, Matrix4f mat)macro float[<2>].rotate(self, float angle)macro float[<2>].angle(self, float[<2>] v2)macro double[<2>].transform(self, Matrix4 mat)macro double[<2>].rotate(self, double angle)macro double[<2>].angle(self, double[<2>] v2)macro float[<*>].clamp_mag(self, float min, float max)macro double[<*>].clamp_mag(self, double min, double max)macro float[<*>].towards(self, float[<*>] target, float max_distance)macro double[<*>].towards(self, double[<*>] target, double max_distance)fn float[<3>] float[<3>].cross(self, float[<3>] v2)fn double[<3>] double[<3>].cross(self, double[<3>] v2)fn float[<3>] float[<3>].perpendicular(self)fn double[<3>] double[<3>].perpendicular(self)fn float[<3>] float[<3>].barycenter(self, float[<3>] a, float[<3>] b, float[<3>] c)fn double[<3>] double[<3>].barycenter(self, double[<3>] a, double[<3>] b, double[<3>] c)fn float[<3>] float[<3>].transform(self, Matrix4f mat)fn double[<3>] double[<3>].transform(self, Matrix4 mat)fn float float[<3>].angle(self, float[<3>] v2)fn double double[<3>].angle(self, double[<3>] v2)fn float[<3>] float[<3>].refract(self, float[<3>] n, float r)fn double[<3>] double[<3>].refract(self, double[<3>] n, double r)fn float[<3>] float[<3>].rotate_quat(self, Quaternionf q)fn double[<3>] double[<3>].rotate_quat(self, Quaternion q)fn float[<3>] float[<3>].rotate_axis(self, float[<3>] axis, float angle)fn double[<3>] double[<3>].rotate_axis(self, double[<3>] axis, double angle)fn float[<3>] float[<3>].unproject(self, Matrix4f projection, Matrix4f view)fn double[<3>] double[<3>].unproject(self, Matrix4 projection, Matrix4 view)fn void ortho_normalize(float[<3>]* v1, float[<3>]* v2)fn void ortho_normalized(double[<3>]* v1, double[<3>]* v2)std::net
Section titled “std::net”enum IpProtocol : char (AIFamily ai_family)struct InetAddress (Printable)fn usz? InetAddress.to_format(InetAddress* addr, Formatter* formatter) @dynamicfn String InetAddress.to_string(&self, Allocator allocator)fn String InetAddress.to_tstring(&self)fn InetAddress? ipv6_from_str(String s)fn InetAddress? ipv4_from_str(String s)fn bool InetAddress.is_loopback(InetAddress* addr)fn bool InetAddress.is_any_local(InetAddress* addr)fn bool InetAddress.is_link_local(InetAddress* addr)fn bool InetAddress.is_site_local(InetAddress* addr)fn bool InetAddress.is_multicast(InetAddress* addr)fn bool InetAddress.is_multicast_global(InetAddress* addr)fn bool InetAddress.is_multicast_node_local(InetAddress* addr)fn bool InetAddress.is_multicast_site_local(InetAddress* addr)fn bool InetAddress.is_multicast_org_local(InetAddress* addr)fn bool InetAddress.is_multicast_link_local(InetAddress* addr)fn AddrInfo*? addrinfo(String host, uint port, AIFamily ai_family, AISockType ai_socktype) @if(os::SUPPORTS_INET)faultdef INVALID_URL, URL_TOO_LONG, INVALID_SOCKET, GENERAL_ERROR, INVALID_IP_STRING, ADDRINFO_FAILED, CONNECT_FAILED, LISTEN_FAILED, ACCEPT_FAILED, WRITE_FAILED, READ_FAILED, SOCKOPT_FAILED,
SOCKETS_NOT_INITIALIZED, STILL_PROCESSING_CALLBACK, BAD_SOCKET_DESCRIPTOR, NOT_A_SOCKET, CONNECTION_REFUSED, CONNECTION_TIMED_OUT, ADDRESS_IN_USE, CONNECTION_ALREADY_IN_PROGRESS, ALREADY_CONNECTED, NETWORK_UNREACHABLE, OPERATION_NOT_SUPPORTED_ON_SOCKET, CONNECTION_RESETfn uint? ipv4toint(String s)fn String? int_to_ipv4(uint val, Allocator allocator)std::net @if(os::SUPPORTS_INET)
Section titled “std::net @if(os::SUPPORTS_INET)”struct Socket (InStream, OutStream)macro void @loop_over_ai(AddrInfo* ai; @body(NativeSocket fd, AddrInfo* ai))typedef PollSubscribes = ushorttypedef PollEvents = ushortstruct Pollfn ulong? poll(Poll[] polls, Duration timeout)fn ulong? poll_ms(Poll[] polls, long timeout_ms)macro Socket new_socket(fd, ai)enum SocketOption : char (CInt value)fn bool? Socket.get_broadcast(&self)fn bool? Socket.get_keepalive(&self)fn bool? Socket.get_reuseaddr(&self)fn bool? Socket.get_dontroute(&self)fn bool? Socket.get_oobinline(&self)fn void? Socket.set_broadcast(&self, bool value)fn void? Socket.set_keepalive(&self, bool value)fn void? Socket.set_reuseaddr(&self, bool value)fn void? Socket.set_dontroute(&self, bool value)fn void? Socket.set_oobinline(&self, bool value)fn void? Socket.set_option(&self, SocketOption option, bool value)fn bool? Socket.get_option(&self, SocketOption option)fn usz? Socket.read(&self, char[] bytes) @dynamicfn char? Socket.read_byte(&self) @dynamicfn usz? Socket.write(&self, char[] bytes) @dynamicfn void? Socket.write_byte(&self, char byte) @dynamicfn void? Socket.destroy(&self) @dynamicfn void? Socket.close(&self) @inline @dynamicfn usz? Socket.peek(&self, char[] bytes) @dynamicenum SocketShutdownHow : (CInt native_value)fn void? Socket.shutdown(&self, SocketShutdownHow how)fn bool last_error_is_delayed_connect()std::net::os
Section titled “std::net::os”typedef AIFamily = CInttypedef AIProtocol = CInttypedef AISockType = CInttypedef AIFlags = CIntalias Socklen_t @if(!env::WIN32) = CUIntalias Socklen_t @if(env::WIN32) = usztypedef SockAddrPtr = void*struct AddrInfoextern fn CInt getaddrinfo(ZString nodename, ZString servname, AddrInfo* hints, AddrInfo** res) @if(SUPPORTS_INET)std::net::os @if(env::ANDROID)
Section titled “std::net::os @if(env::ANDROID)”std::net::os @if(env::DARWIN)
Section titled “std::net::os @if(env::DARWIN)”std::net::os @if(env::LINUX)
Section titled “std::net::os @if(env::LINUX)”std::net::os @if(env::POSIX && SUPPORTS_INET)
Section titled “std::net::os @if(env::POSIX && SUPPORTS_INET)”typedef NativeSocket = inline Fdstruct Posix_pollfdalias Posix_nfds_t = CUIntextern fn CInt connect(NativeSocket socket, SockAddrPtr address, Socklen_t address_len)fn fault socket_error()macro bool NativeSocket.is_valid(self)macro void? NativeSocket.close(self)macro void? NativeSocket.set_non_blocking(self, bool non_blocking)macro bool NativeSocket.is_non_blocking(self)std::net::os @if(env::WIN32)
Section titled “std::net::os @if(env::WIN32)”typedef NativeSocket = inline Win32_SOCKETextern fn CInt ioctlsocket(NativeSocket, CLong cmd, CULong *argp)fn void? NativeSocket.set_non_blocking(self, bool non_blocking)macro void? NativeSocket.close(self)fn fault convert_error(WSAError error)fn fault socket_error()std::net::tcp @if(os::SUPPORTS_INET)
Section titled “std::net::tcp @if(os::SUPPORTS_INET)”typedef TcpSocket = inline Sockettypedef TcpServerSocket = inline Socketfn TcpSocket? connect(String host, uint port, Duration timeout = time::DURATION_ZERO, SocketOption... options, IpProtocol ip_protocol = UNSPECIFIED)fn TcpSocket? connect_async(String host, uint port, SocketOption... options, IpProtocol ip_protocol = UNSPECIFIED)fn TcpSocket? connect_to(AddrInfo* ai, SocketOption... options)fn TcpSocket? connect_async_to(AddrInfo* ai, SocketOption... options)fn TcpServerSocket? listen(String host, uint port, uint backlog, SocketOption... options, IpProtocol ip_protocol = UNSPECIFIED)fn TcpSocket? accept(TcpServerSocket* server_socket)fn TcpServerSocket? listen_to(AddrInfo* ai, uint backlog, SocketOption... options)std::net::udp @if(os::SUPPORTS_INET)
Section titled “std::net::udp @if(os::SUPPORTS_INET)”typedef UdpSocket = inline Socketfn UdpSocket? connect(String host, uint port, SocketOption... options, IpProtocol ip_protocol = UNSPECIFIED)fn UdpSocket? connect_to(AddrInfo* ai, SocketOption... options)fn UdpSocket? connect_async(String host, uint port, SocketOption... options, IpProtocol ip_protocol = UNSPECIFIED)fn UdpSocket? connect_async_to(AddrInfo* ai, SocketOption... options)std::net::url
Section titled “std::net::url”faultdef EMPTY, INVALID_SCHEME, INVALID_USER, INVALID_PASSWORD, INVALID_HOST, INVALID_PATH, INVALID_FRAGMENTstruct Url(Printable)fn Url? tparse(String url_string)fn Url? parse(Allocator allocator, String url_string)fn usz? Url.to_format(&self, Formatter* f) @dynamicfn String Url.to_string(&self, Allocator allocator)alias UrlQueryValueList = List{String}struct UrlQueryValuesfn UrlQueryValues parse_query_to_temp(String query)fn UrlQueryValues parse_query(Allocator allocator, String query)fn UrlQueryValues* UrlQueryValues.add(&self, String key, String value)fn usz? UrlQueryValues.to_format(&self, Formatter* f) @dynamicfn void UrlQueryValues.free(&self)fn void Url.free(&self)enum UrlEncodingMode : char (String allowed)faultdef INVALID_HEXfn usz encode_len(String s, UrlEncodingMode mode) @inlinefn String encode(Allocator allocator, String s, UrlEncodingMode mode)fn String tencode(String s, UrlEncodingMode mode)fn usz? decode_len(String s, UrlEncodingMode mode) @inlinefn String? decode(Allocator allocator, String s, UrlEncodingMode mode)fn String? tdecode(String s, UrlEncodingMode mode)std::os
Section titled “std::os”fn void exit(int result) @weak @noreturnfn void fastexit(int result) @weak @noreturnstd::os @if(env::DARWIN)
Section titled “std::os @if(env::DARWIN)”fn uint num_cpu()std::os @if(env::LINUX)
Section titled “std::os @if(env::LINUX)”fn uint num_cpu()std::os @if(env::WIN32)
Section titled “std::os @if(env::WIN32)”fn uint num_cpu()std::os::android @if(env::ANDROID)
Section titled “std::os::android @if(env::ANDROID)”enum LogPriority : (CInt val)enum LogId : (CInt val)struct LogMessage @packedextern fn CInt log_write(LogPriority prio, ZString tag, ZString text) @extern("__android_log_write")extern fn CInt log_buf_write(CInt bufID, CInt prio, ZString tag, ZString text) @extern("__android_log_buf_write")std::os::backtrace
Section titled “std::os::backtrace”faultdef SEGMENT_NOT_FOUND, EXECUTABLE_PATH_NOT_FOUND, IMAGE_NOT_FOUND, NO_BACKTRACE_SYMBOLS, RESOLUTION_FAILEDstruct Backtrace (Printable)fn bool Backtrace.has_file(&self)fn bool Backtrace.is_unknown(&self)fn usz? Backtrace.to_format(&self, Formatter* formatter) @dynamicfn void Backtrace.free(&self)fn Backtrace* Backtrace.init(&self, Allocator allocator, uptr offset, String function, String object_file, String file = "", uint line = 0)fn void*[] capture_current(void*[] buffer)alias BacktraceList = List{Backtrace}alias symbolize_backtrace @if(env::LINUX) = linux::symbolize_backtracealias symbolize_backtrace @if(env::WIN32) = win32::symbolize_backtracealias symbolize_backtrace @if(env::DARWIN) = darwin::symbolize_backtracealias symbolize_backtrace @if(env::OPENBSD) = openbsd::symbolize_backtracefn BacktraceList? symbolize_backtrace(Allocator allocator, void*[] backtrace) @if(!env::NATIVE_STACKTRACE)std::os::darwin @if(env::DARWIN)
Section titled “std::os::darwin @if(env::DARWIN)”extern fn CInt sysctl(CInt *name, CUInt namelen, void *oldp, usz *oldlenp, void *newp, usz newlen)struct Darwin_segment_command_64struct Darwin_mach_timebase_infoalias Darwin_mach_timebase_info_t = Darwin_mach_timebase_infoalias Darwin_mach_timebase_info_data_t = Darwin_mach_timebase_infoextern fn void mach_timebase_info(Darwin_mach_timebase_info_data_t* timebase)fn BacktraceList? symbolize_backtrace(Allocator allocator, void*[] backtrace)extern fn usz malloc_size(void* ptr)std::os::darwin::cocoa @if(env::OS_TYPE == MACOS) @link("Cocoa.framework")
Section titled “std::os::darwin::cocoa @if(env::OS_TYPE == MACOS) @link("Cocoa.framework")”extern fn int nsApplicationMain(int argc, char **argv) @extern("NSApplicationMain")std::os::env
Section titled “std::os::env”fn String? get_var(Allocator allocator, String name)fn String? tget_var(String name)fn bool set_var(String name, String value, bool overwrite = true)fn String? get_home_dir(Allocator allocator)fn Path? get_config_dir(Allocator allocator)fn bool clear_var(String name)fn String? executable_path()std::os::freebsd @if(env::FREEBSD)
Section titled “std::os::freebsd @if(env::FREEBSD)”std::os::linux @if(env::LINUX)
Section titled “std::os::linux @if(env::LINUX)”extern fn usz malloc_usable_size(void* ptr)extern fn isz readlink(ZString path, char* buf, usz bufsize)struct Elf32_Phdralias Elf64_Addr = ulongalias Elf64_Half = ushortalias Elf64_Off = ulongalias Elf64_Word = uintalias Elf64_Sword = intalias Elf64_Sxword = longalias Elf64_Lword = ulongalias Elf64_Xword = ulongstruct Elf64_Ehdrstruct Elf64_Phdrextern fn CInt dladdr(void* addr, Linux_Dl_info* info)fn Backtrace? backtrace_line_parse(Allocator allocator, String string, String obj_name, String func_name, bool is_inlined)fn BacktraceList? symbolize_backtrace(Allocator allocator, void*[] backtrace)std::os::macos::cf @if(env::DARWIN) @link(env::DARWIN, "CoreFoundation.framework")
Section titled “std::os::macos::cf @if(env::DARWIN) @link(env::DARWIN, "CoreFoundation.framework")”typedef CFAllocatorRef = void*typedef CFAllocatorContextRef = void*alias CFOptionFlags = uszmacro CFAllocatorRef default_allocator()macro void CFAllocatorRef.dealloc(CFAllocatorRef allocator, void* ptr)macro void* CFAllocatorRef.alloc(CFAllocatorRef allocator, usz size)macro usz CFAllocatorRef.get_preferred_size(CFAllocatorRef allocator, usz req_size)macro void CFAllocatorRef.set_default(CFAllocatorRef allocator)extern fn CFAllocatorRef macos_CFAllocatorCreate(CFAllocatorRef allocator, CFAllocatorContextRef context) @extern("CFAllocatorCreate") @builtintypedef CFArrayRef = void*typedef CFArrayCallBacksRef = void*typedef CFMutableArrayRef = void*extern fn CFArrayRef macos_CFArrayCreate(CFAllocatorRef allocator, void** values, CFIndex num_values, CFArrayCallBacksRef callBacks) @extern("CFArrayCreate") @builtintypedef CFTypeRef = void*alias CFIndex = iszstruct CFRangeextern fn CFTypeRef macos_CFRetain(CFTypeRef cf) @extern("CFRetain") @builtinstd::os::macos::objc @if(env::DARWIN) @link(env::DARWIN, "CoreFoundation.framework")
Section titled “std::os::macos::objc @if(env::DARWIN) @link(env::DARWIN, "CoreFoundation.framework")”typedef ObjcClass = void*typedef ObjcMethod = void*typedef ObjcIvar = void*typedef ObjcSelector = void*alias ObjcId = void*alias SendVoid = fn void*(void*, ObjcSelector)faultdef CLASS_NOT_FOUND, UNKNOWN_EVENTmacro ZString ObjcClass.name(ObjcClass cls)macro ObjcClass ObjcClass.superclass(ObjcClass cls)macro bool ObjcClass.responds_to(ObjcClass cls, ObjcSelector sel)macro ObjcMethod ObjcClass.method(ObjcClass cls, ObjcSelector name)macro bool ObjcSelector.equals(ObjcSelector a, ObjcSelector b)macro bool ObjcClass.equals(ObjcClass a, ObjcClass b)fn ObjcId alloc(ObjcClass cls)fn void release(ObjcId id)macro ObjcClass? class_by_name(ZString c)macro ObjcClass[] class_get_list(Allocator allocator)extern fn void msgSend(...) @extern("objc_msgSend") @builtinextern fn ObjcClass getClass(ZString name) @extern("objc_getClass")enum ApplicationActivationPolicy : (int val)enum WindowStyleMask : (int val)enum BackingStore : (int val)enum EventType : (long val)fn EventType? event_type_from(int val)enum EventMask : (long val)enum EventModifierFlag : (int val)std::os::netbsd @if(env::NETBSD)
Section titled “std::os::netbsd @if(env::NETBSD)”std::os::openbsd @if(env::OPENBSD)
Section titled “std::os::openbsd @if(env::OPENBSD)”extern fn ZString* backtrace_symbols_fmt(void **addrlist, usz len, ZString fmt)fn BacktraceList? symbolize_backtrace(Allocator allocator, void*[] backtrace)std::os::posix @if(env::POSIX)
Section titled “std::os::posix @if(env::POSIX)”extern fn CInt clock_gettime(int type, TimeSpec *time)alias Mode_t = uinttypedef DIRPtr = void*struct Posix_direntextern fn int rmdir(ZString)extern fn CLong sysconf(CInt name)extern fn CInt posix_memalign(void **memptr, usz alignment, usz size)extern fn void* mmap(void*, usz, CInt, CInt, CInt, Off_t)struct Posix_spawn_file_actions_tstruct Posix_spawnattr_textern fn CInt posix_spawn_file_actions_init(Posix_spawn_file_actions_t *file_actions)alias PosixThreadFn = fn void*(void*)typedef Pthread_t = void*extern fn CInt pthread_create(Pthread_t*, Pthread_attr_t*, PosixThreadFn, void*)std::os::process @if(env::WIN32 || env::POSIX)
Section titled “std::os::process @if(env::WIN32 || env::POSIX)”faultdef FAILED_TO_CREATE_PIPE, FAILED_TO_OPEN_STDIN, FAILED_TO_OPEN_STDOUT, FAILED_TO_OPEN_STDERR, FAILED_TO_START_PROCESS, FAILED_TO_INITIALIZE_ACTIONS, PROCESS_JOIN_FAILED, PROCESS_TERMINATION_FAILED, READ_FAILEDstruct SubProcessbitstruct SubProcessOptions : intfn SubProcess? create(String[] command_line, SubProcessOptions options = {}, String[] environment = {}) @if(env::WIN32)fn String? execute_stdout_to_buffer(char[] buffer, String[] command_line, SubProcessOptions options = {}, String[] environment = {})fn SubProcess? create(String[] command_line, SubProcessOptions options = {}, String[] environment = {}) @if(env::POSIX)fn CInt? SubProcess.join(&self) @if(env::POSIX)fn File SubProcess.stdout(&self)fn File SubProcess.stderr(&self)fn CInt? SubProcess.join(&self) @if(env::WIN32)fn bool SubProcess.destroy(&self)fn void? SubProcess.terminate(&self)fn usz? SubProcess.read_stdout(&self, char* buffer, usz size)fn usz? SubProcess.read_stderr(&self, char* buffer, usz size)fn bool? SubProcess.is_running(&self)std::os::win32
Section titled “std::os::win32”alias Win32_BOOL = intalias Win32_BOOLEAN = Win32_BYTEalias Win32_BYTE = charalias Win32_CCHAR = cinterop::CCharalias Win32_CHAR = cinterop::CCharalias Win32_COLORREF = Win32_DWORDalias Win32_DWORD = uintalias Win32_DWORDLONG = ulongalias Win32_DWORD_PTR = Win32_ULONG_PTRalias Win32_DWORD32 = uintalias Win32_DWORD64 = ulongalias Win32_FLOAT = floatalias Win32_HACCEL = Win32_HANDLEalias Win32_HALF_PTR = intalias Win32_HANDLE = Win32_PVOIDalias Win32_HBITMAP = Win32_HANDLEalias Win32_HBRUSH = Win32_HANDLEalias Win32_HCOLORSPACE = Win32_HANDLEalias Win32_HCONV = Win32_HANDLEalias Win32_HCONVLIST = Win32_HANDLEalias Win32_HCURSOR = Win32_HICONalias Win32_HDC = Win32_HANDLEalias Win32_HDDEDATA = Win32_HANDLEalias Win32_HDESK = Win32_HANDLEalias Win32_HDROP = Win32_HANDLEalias Win32_HDWP = Win32_HANDLEalias Win32_HFILE = intalias Win32_HFONT = Win32_HANDLEalias Win32_HGDIOBJ = Win32_HANDLEalias Win32_HGLOBAL = Win32_HANDLEalias Win32_HHOOK = Win32_HANDLEalias Win32_HICON = Win32_HANDLEalias Win32_HINSTANCE = Win32_HANDLEalias Win32_HKEY = Win32_HANDLEalias Win32_HKL = Win32_HANDLEalias Win32_HLOCAL = Win32_HANDLEalias Win32_HMENU = Win32_HANDLEalias Win32_HMETAFILE = Win32_HANDLEalias Win32_HMODULE = Win32_HANDLEalias Win32_HMONITOR = Win32_HANDLEalias Win32_HPALETTE = Win32_HANDLEalias Win32_HPEN = Win32_HANDLEalias Win32_HRESULT = Win32_LONGalias Win32_HRGN = Win32_HANDLEalias Win32_HRSRC = Win32_HANDLEalias Win32_HSZ = Win32_HANDLEalias Win32_HWINSTA = Win32_HANDLEalias Win32_HWND = Win32_HANDLEalias Win32_INT = intalias Win32_INT_PTR = iptralias Win32_INT8 = icharalias Win32_INT16 = shortalias Win32_INT32 = intalias Win32_INT64 = longalias Win32_LANGID = Win32_WORDalias Win32_LCID = Win32_DWORDalias Win32_LCTYPE = Win32_DWORDalias Win32_LGRPID = Win32_DWORDalias Win32_LONG = intalias Win32_LONGLONG = longalias Win32_LONG_PTR = iptralias Win32_LONG32 = intalias Win32_LONG64 = longalias Win32_LPARAM = Win32_LONG_PTRalias Win32_LPBOOL = Win32_BOOL*alias Win32_LPBYTE = Win32_BYTE*alias Win32_LPCOLORREF = Win32_DWORD*alias Win32_LPCSTR = Win32_CCHAR*alias Win32_LPCTSTR = Win32_LPCWSTRalias Win32_LPCVOID = void*alias Win32_LPCWSTR = Win32_WCHAR*alias Win32_LPDWORD = Win32_DWORD*alias Win32_LPHANDLE = Win32_HANDLE*alias Win32_LPINT = int*alias Win32_LPLONG = int*alias Win32_LPSTR = Win32_CCHAR*alias Win32_LPTSTR = Win32_LPWSTRalias Win32_LPVOID = void*alias Win32_LPWORD = Win32_WORD*alias Win32_LPWSTR = Win32_WCHAR*alias Win32_LRESULT = Win32_LONG_PTRalias Win32_NTSTATUS = Win32_LONGalias Win32_PBOOL = Win32_BOOL*alias Win32_PBOOLEAN = Win32_BOOLEAN*alias Win32_PBYTE = Win32_BYTE*alias Win32_PCHAR = Win32_CHAR*alias Win32_PCSTR = Win32_CHAR*alias Win32_PCTSTR = Win32_LPCWSTRalias Win32_PCUNICODE_STRING = Win32_UNICODE_STRING*alias Win32_PCWSTR = WStringalias Win32_PDWORD = Win32_DWORD*alias Win32_PDWORDLONG = Win32_DWORDLONG*alias Win32_PDWORDPTR = Win32_DWORD_PTR*alias Win32_PDWORD32 = Win32_DWORD32*alias Win32_PDWORD64 = Win32_DWORD64*alias Win32_PFLOAT = Win32_FLOAT*alias Win32_PHALFPTR = Win32_HALF_PTR*alias Win32_PHANDLE = Win32_HANDLE*alias Win32_PHKEY = Win32_HKEY*alias Win32_PINT = int*alias Win32_PINTPTR = Win32_INT_PTR*alias Win32_PINT8 = Win32_INT8*alias Win32_PINT16 = Win32_INT16*alias Win32_PINT32 = Win32_INT32*alias Win32_PINT64 = Win32_INT64*alias Win32_PLCID = Win32_PDWORDalias Win32_PLONG = Win32_LONG*alias Win32_PLONGLONG = Win32_LONGLONG*alias Win32_PLONG_PTR = Win32_LONG_PTR*alias Win32_PLONG32 = Win32_LONG32*alias Win32_PLONG64 = Win32_LONG64*alias Win32_POINTER_32 = uintalias Win32_POINTER_64 = uptralias Win32_POINTER_SIGNED = iptralias Win32_POINTER_UNSIGNED = uptralias Win32_PSHORT = Win32_SHORT*alias Win32_PSIZE_T = usz*alias Win32_PSSIZE_T = isz*alias Win32_PSTR = Win32_CHAR*alias Win32_PTBYTE = Win32_TBYTE*alias Win32_PTCHAR = Win32_TCHAR*alias Win32_PTSTR = Win32_LPWSTRalias Win32_PUCHAR = Win32_UCHAR*alias Win32_PUHALFPTR = Win32_UHALF_PTR*alias Win32_PUINT = Win32_UINT*alias Win32_PUINTPTR = Win32_UINT_PTR*alias Win32_PUINT8 = Win32_UINT8*alias Win32_PUINT16 = Win32_UINT16*alias Win32_PUINT32 = Win32_UINT32*alias Win32_PUINT64 = Win32_UINT64*alias Win32_PULONG = Win32_ULONG*alias Win32_PULONGLONG = Win32_ULONGLONG*alias Win32_PULONG_PTR = Win32_ULONG_PTR*alias Win32_PULONG32 = Win32_ULONG32*alias Win32_PULONG64 = Win32_ULONG64*alias Win32_PUNICODE_STRING = Win32_UNICODE_STRING*alias Win32_PUSHORT = Win32_USHORT*alias Win32_PVOID = void*alias Win32_PWCHAR = Win32_WCHAR*alias Win32_PWORD = Win32_WORD*alias Win32_PWSTR = Win32_WCHAR*alias Win32_QWORD = ulongalias Win32_SC_HANDLE = Win32_HANDLEalias Win32_SC_LOCK = Win32_LPVOIDalias Win32_SERVICE_STATUS_HANDLE = Win32_HANDLEalias Win32_SHORT = shortalias Win32_SIZE_T = uszalias Win32_SOCKET = Win32_HANDLEalias Win32_SSIZE_T = iszalias Win32_TBYTE = Win32_WCHARalias Win32_TCHAR = Win32_WCHARalias Win32_UCHAR = charalias Win32_UHALF_PTR = uintalias Win32_UINT = uintalias Win32_UINT_PTR = uptralias Win32_UINT8 = charalias Win32_UINT16 = ushortalias Win32_UINT32 = uintalias Win32_UINT64 = ulongalias Win32_ULONG = uintalias Win32_ULONGLONG = ulongalias Win32_ULONG_PTR = ulongalias Win32_ULONG32 = uintalias Win32_ULONG64 = ulongalias Win32_USHORT = ushortalias Win32_USN = Win32_LONGLONGalias Win32_WCHAR = Char16alias Win32_WORD = ushortalias Win32_WPARAM = Win32_UINT_PTRstruct Win32_UNICODE_STRINGtypedef Win32_CRITICAL_SECTION = ulong[5]typedef Win32_CONDITION_VARIABLE = void*typedef Win32_SRWLOCK = void*typedef Win32_INIT_ONCE = void*struct Win32_SECURITY_ATTRIBUTESalias Win32_LPSECURITY_ATTRIBUTES = Win32_SECURITY_ATTRIBUTES*alias Win32_PSECURITY_ATTRIBUTES = Win32_SECURITY_ATTRIBUTES*struct Win32_STARTUPINFOWstruct Win32_OVERLAPPEDalias Win32_LPOVERLAPPED = Win32_OVERLAPPED*alias Win32_LPSTARTUPINFOW = Win32_STARTUPINFOW*struct Win32_STARTUPINFOEXWalias Win32_LPPROC_THREAD_ATTRIBUTE_LIST = void*alias Win32_LPSTARTUPINFOEXW = Win32_STARTUPINFOEXW*struct Win32_FILETIMEstruct Win32_PROCESS_INFORMATIONalias Win32_PPROCESS_INFORMATION = Win32_PROCESS_INFORMATION*alias Win32_LPPROCESS_INFORMATION = Win32_PROCESS_INFORMATION*struct Win32_SYSTEM_INFOalias Win32_LPSYSTEM_INFO = Win32_SYSTEM_INFO*struct Win32_MODULEINFOstruct Win32_IMAGEHLP_LINE64enum Win32_SYM_TYPEstruct Win32_GUIDstruct Win32_IMAGEHLP_MODULE64alias Win32_PIMAGEHLP_MODULE64 = Win32_IMAGEHLP_MODULE64*struct Win32_ARM64_NT_CONTEXT @align(16)struct Win32_ARM64_NT_NEON128struct Win32_XMM_SAVE_AREA32struct Win32_AMD64_CONTEXT @align(16)alias CONTEXT_CONTROL = CONTEXT_AMD64_CONTROLalias CONTEXT_FULL = CONTEXT_AMD64_FULLalias CONTEXT_ALL = CONTEXT_AMD64_ALLalias Win32_CONTEXT = Win32_AMD64_CONTEXTalias Win32_PCONTEXT = Win32_CONTEXT*struct Win32_M128A @align(16)struct Win32_IMAGE_DATA_DIRECTORYstruct Win32_IMAGE_OPTIONAL_HEADER64alias Win32_PIMAGE_OPTIONAL_HEADER64 = Win32_IMAGE_OPTIONAL_HEADER64*struct Win32_IMAGE_FILE_HEADERalias Win32_PIMAGE_FILE_HEADER = Win32_IMAGE_FILE_HEADER*struct Win32_IMAGE_NT_HEADERSalias Win32_PIMAGE_NT_HEADERS = Win32_IMAGE_NT_HEADERS*struct Win32_SYMBOL_INFOalias Win32_PSYMBOL_INFO = Win32_SYMBOL_INFO*struct Win32_MODLOAD_DATAenum Win32_ADDRESS_MODEstruct Win32_ADDRESS64struct Win32_KDHELP64struct Win32_STACKFRAME64alias Win32_PREAD_PROCESS_MEMORY_ROUTINE64 = fn Win32_BOOL(Win32_HANDLE hProcess, Win32_DWORD64 qwBaseAddress, Win32_PVOID lpBuffer, Win32_DWORD nSize, Win32_LPDWORD lpNumberOfBytesRead)alias Win32_PFUNCTION_TABLE_ACCESS_ROUTINE64 = fn Win32_PVOID(Win32_HANDLE ahProcess, Win32_DWORD64 addrBase)alias Win32_PGET_MODULE_BASE_ROUTINE64 = fn Win32_DWORD64(Win32_HANDLE hProcess, Win32_DWORD64 address)alias Win32_PTRANSLATE_ADDRESS_ROUTINE64 = fn Win32_DWORD64(Win32_HANDLE hProcess, Win32_HANDLE hThread, Win32_LPADDRESS64 lpaddr)alias Win32_PKDHELP64 = Win32_KDHELP64*alias Win32_LPADDRESS64 = Win32_ADDRESS64*alias Win32_LPSTACKFRAME64 = Win32_STACKFRAME64*alias Win32_PMODLOAD_DATA = Win32_MODLOAD_DATA*alias Win32_PIMAGEHLP_LINE64 = Win32_IMAGEHLP_LINE64*alias Win32_LPMODULEINFO = Win32_MODULEINFO*std::os::win32 @if(env::WIN32)
Section titled “std::os::win32 @if(env::WIN32)”extern fn void getSystemTimeAsFileTime(Win32_FILETIME* time) @extern("GetSystemTimeAsFileTime")enum Win32_GET_FILEEX_INFO_LEVELSstruct Win32_FILE_ATTRIBUTE_DATAstruct Win32_WIN32_FIND_DATAWalias Win32_LPWIN32_FIND_DATAW = Win32_WIN32_FIND_DATAW*extern fn Win32_BOOL closeHandle(Win32_HANDLE) @extern("CloseHandle")extern fn Win32_HBRUSH createSolidBrush(Win32_COLORREF) @extern("CreateSolidBrush")extern fn Win32_DWORD getLastError() @extern("GetLastError")extern fn void* _aligned_malloc(usz size, usz alignment)enum Win32_AllocationType : const Win32_DWORDenum Win32_Protect : const Win32_DWORDenum Win32_FreeType : const Win32_DWORDextern fn Win32_LPVOID virtualAlloc(Win32_LPVOID lpAddres, Win32_SIZE_T dwSize, Win32_AllocationType flAllocationType, Win32_Protect flProtect) @extern("VirtualAlloc")alias Win32_INIT_ONCE_FN = fn Win32_BOOL(Win32_INIT_ONCE* initOnce, void* parameter, void** context)extern fn void initializeCriticalSection(Win32_CRITICAL_SECTION* section) @extern("InitializeCriticalSection")struct Symbolfn BacktraceList? symbolize_backtrace(Allocator allocator, void*[] backtrace)fn Backtrace? resolve_backtrace(Allocator allocator, void* addr, Win32_HANDLE process)struct Win32_KEY_EVENT_RECORDstruct Win32_COORDstruct Win32_MOUSE_EVENT_RECORDstruct Win32_WINDOW_BUFFER_SIZE_RECORDstruct Win32_MENU_EVENT_RECORDstruct Win32_FOCUS_EVENT_RECORDstruct Win32_INPUT_RECORDalias Win32_PCOORD = Win32_COORD*struct Win32_RECTstruct Win32_POINTstruct Win32_SIZEstruct Win32_WSABUFstruct Win32_SOCKADDRalias Win32_PSIZE = Win32_SIZE*alias Win32_NPSIZE = Win32_SIZE*alias Win32_LPSIZE = Win32_SIZE*alias Win32_PPOINT = Win32_POINT*alias Win32_NPOINT = Win32_POINT*alias Win32_LPOINT = Win32_POINT*alias Win32_PRECT = Win32_RECT*alias Win32_NPRECT = Win32_RECT*alias Win32_LPRECT = Win32_RECT*alias Win32_PWSABUF = Win32_WSABUF*alias Win32_LPWSABUF = Win32_WSABUF*alias Win32_PSOCKADDR = Win32_SOCKADDR*alias Win32_LPSOCKADDR = Win32_SOCKADDR*enum Win32_MEM_EXTENDED_PARAMETER_TYPE : CIntalias Win32_PMEM_EXTENDED_PARAMETER_TYPE = Win32_MEM_EXTENDED_PARAMETER_TYPEenum Win32_MEM_EXTENDED_PARAMETER_ATTRIBUTE : const Win32_DWORD64struct Win32_MEM_EXTENDED_PARAMETERalias Win32_PMEM_EXTENDED_PARAMETER = Win32_MEM_EXTENDED_PARAMETER*alias Win32_WNDPROC = fn Win32_LRESULT(Win32_HWND, Win32_UINT, Win32_WPARAM, Win32_LPARAM)struct Win32_WNDCLASSEXWstruct Win32_MSGstruct Win32_PAINTSTRUCTalias Win32_PWNDCLASSEXW = Win32_WNDCLASSEXW*alias Win32_LPWNDCLASSEXW = Win32_WNDCLASSEXW*alias Win32_NPWNDCLASSEXW = Win32_WNDCLASSEXW*alias Win32_PPAINTSTRUCT = Win32_PAINTSTRUCT*alias Win32_LPPAINTSTRUCT = Win32_PAINTSTRUCT*alias Win32_NPPAINTSTRUCT = Win32_PAINTSTRUCT*alias Win32_PMSG = Win32_MSG*alias Win32_LPMSG = Win32_MSG*alias Win32_NPMSG = Win32_MSG*alias Win32_ATOM = ushortextern fn Win32_HDC beginPaint(Win32_HWND, Win32_LPPAINTSTRUCT) @extern("BeginPaint")macro setWindowLongPtr(Win32_HWND hWnd, CInt nIndex, dwNewLong)struct Win32_addrinfoalias Win32_ADDRINFO = Win32_addrinfoalias Win32_ADDRINFOA = Win32_ADDRINFOalias Win32_PADDRINFOA = Win32_ADDRINFO*struct Win32_addrinfoWalias Win32_ADDRINFOW = Win32_addrinfoWalias Win32_PADDRINFOW = Win32_addrinfoW*typedef WSAError = intstruct Win32_pollfdalias Win32_WSAPOLLFD = Win32_pollfdalias Win32_PWSAPOLLFD = Win32_WSAPOLLFD*alias Win32_LPWSAPOLLFD = Win32_WSAPOLLFD*struct Win32_InAddrstruct Win32_SOCKADDR_INstruct Win32_SOCKADDR_STORAGEalias Win32_WSAOVERLAPPED = Win32_OVERLAPPEDalias Win32_LPWSAOVERLAPPED = Win32_WSAOVERLAPPED*alias Win32_LPWSAOVERLAPPED_COMPLETION_ROUTINE = fn void ( Win32_DWORD dwError, Win32_DWORD cbTransferred, Win32_LPWSAOVERLAPPED lpOverlapped, Win32_DWORD dwFlags)alias Win32_LPFN_WSARECV = fn CInt( Win32_SOCKET socket, Win32_LPWSABUF buffers, Win32_DWORD buffer_count, Win32_LPDWORD bytes, Win32_LPDWORD flags, Win32_LPWSAOVERLAPPED overlapped, Win32_LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine)alias Win32_LPFN_WSARECVFROM = fn CInt( Win32_SOCKET socket, Win32_LPWSABUF buffers, Win32_DWORD buffer_count, Win32_LPDWORD bytes, Win32_LPDWORD flags, Win32_SOCKADDR* addr, Win32_LPINT addr_len, Win32_LPWSAOVERLAPPED overlapped, Win32_LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine)alias Win32_LPFn_CONNECTEX = fn bool( Win32_SOCKET, Win32_SOCKADDR*, Win32_INT, Win32_PVOID, Win32_DWORD, Win32_LPDWORD, void*)alias Win32_LPFn_ACCEPTEX = fn bool( Win32_SOCKET, Win32_SOCKET, Win32_PVOID, Win32_DWORD, Win32_DWORD, Win32_DWORD, Win32_LPDWORD, void*)extern fn CInt wsaPoll(Win32_LPWSAPOLLFD fdArray, Win32_ULONG fds, Win32_INT timeout) @extern("WSAPoll")std::sort
Section titled “std::sort”macro usz binarysearch(list, x, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtinmacro countingsort(list, key_fn = EMPTY_MACRO_SLOT) @builtinmacro insertionsort_indexed(list, start, end, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtinmacro quicksort_indexed(list, start, end, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtinmacro insertionsort(list, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtin @safemacromacro quicksort(list, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtinmacro quickselect(list, isz k, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtinmacro usz len_from_list(list)macro bool @is_sortable(#list)macro bool @is_valid_context(#cmp, #context)macro bool @is_valid_cmp_fn(#cmp, #list, #context)macro bool @is_cmp_key_fn(#key_fn, #list)macro bool is_sorted(list, cmp = EMPTY_MACRO_SLOT, ctx = EMPTY_MACRO_SLOT) @builtinstd::sort::cs{Type, KeyFn}
Section titled “std::sort::cs{Type, KeyFn}”alias ElementType = $typeof((Type){}[0])alias KeyFnReturnType @if(!NO_KEY_FN) = $typefrom(KeyFn.returns)alias KeyFnReturnType @if(NO_KEY_FN) = ElementTypealias CmpCallback @if(KEY_BY_VALUE && NO_KEY_FN) = fn int(ElementType, ElementType)alias CmpCallback @if(!KEY_BY_VALUE && NO_KEY_FN) = fn int(ElementType*, ElementType*)alias CmpCallback @if(KEY_BY_VALUE && !NO_KEY_FN) = fn int(ElementType, ElementType, KeyFn)alias CmpCallback @if(!KEY_BY_VALUE && !NO_KEY_FN) = fn int(ElementType*, ElementType*, KeyFn)fn void csort(Type list, usz low, usz high, KeyFn key_fn, uint byte_idx)std::sort::is{Type, CmpFn, Context}
Section titled “std::sort::is{Type, CmpFn, Context}”alias ElementType = $typeof(((Type){})[0])fn void isort(Type list, usz low, usz high, CmpFn comp, Context context)std::sort::qs{Type, CmpFn, Context}
Section titled “std::sort::qs{Type, CmpFn, Context}”alias ElementType = $typeof(((Type){})[0])fn void qsort(Type list, isz low, isz high, CmpFn cmp, Context context)fn ElementType? qselect(Type list, isz low, isz high, isz k, CmpFn cmp, Context context)macro @partition(Type list, isz l, isz h, CmpFn cmp, Context context)std::thread
Section titled “std::thread”faultdef THREAD_QUEUE_FULLbitstruct MutexType : inttypedef Mutex = NativeMutextypedef RecursiveMutex = inline Mutextypedef TimedMutex = NativeTimedMutextypedef TimedRecursiveMutex = inline TimedMutextypedef ConditionVariable = NativeConditionVariabletypedef Thread = inline NativeThreadtypedef OnceFlag = NativeOnceFlagalias OnceFn = fn void()alias ThreadFn = fn int(void* arg)faultdef INIT_FAILED, DESTROY_FAILED, LOCK_FAILED, LOCK_TIMEOUT, UNLOCK_FAILED, SIGNAL_FAILED, WAIT_FAILED, WAIT_TIMEOUT, DETACH_FAILED, JOIN_FAILED, INTERRUPTED, CHANNEL_CLOSEDmacro void? Mutex.init(&mutex)macro void? RecursiveMutex.init(&mutex)macro void? Mutex.destroy(&mutex)macro void? Mutex.lock(&mutex)macro bool Mutex.try_lock(&mutex)macro void? Mutex.unlock(&mutex)macro void? TimedMutex.init(&mutex)macro void? TimedRecursiveMutex.init(&mutex)macro void? TimedMutex.destroy(&mutex)macro void? TimedMutex.lock(&mutex)macro void? TimedMutex.lock_timeout(&mutex, ulong ms)macro bool TimedMutex.try_lock(&mutex)macro void? TimedMutex.unlock(&mutex)macro void fence(AtomicOrdering $ordering) @safemacromacro void Mutex.@in_lock(&mutex; @body)macro void? ConditionVariable.init(&cond)macro void? ConditionVariable.destroy(&cond)macro void? ConditionVariable.signal(&cond)macro void? ConditionVariable.broadcast(&cond)macro void? ConditionVariable.wait(&cond, Mutex* mutex)macro void? ConditionVariable.wait_timeout(&cond, Mutex* mutex, #ms_or_duration) @safemacromacro void? ConditionVariable.wait_until(&cond, Mutex* mutex, Time time)macro void? Thread.create(&thread, ThreadFn thread_fn, void* arg)macro void? Thread.detach(thread)macro int? Thread.join(thread)macro bool Thread.equals(thread, Thread other)macro void OnceFlag.call(&flag, OnceFn func)macro void yield()macro Thread current()macro void exit(int result)macro void? sleep(Duration d) @maydiscardmacro void? sleep_ms(ulong ms) @maydiscardmacro void? sleep_ns(NanoDuration ns) @maydiscardstd::thread::channel {Type}
Section titled “std::thread::channel {Type}”typedef UnbufferedChannel = void*fn void? UnbufferedChannel.init(&self, Allocator allocator)fn void? UnbufferedChannel.destroy(&self)fn void? UnbufferedChannel.push(self, Type val)fn Type? UnbufferedChannel.pop(self)fn void? UnbufferedChannel.close(self)std::thread::channel{Type}
Section titled “std::thread::channel{Type}”typedef BufferedChannel = void*fn void? BufferedChannel.init(&self, Allocator allocator, usz size = 1)fn void? BufferedChannel.destroy(&self)fn void? BufferedChannel.push(self, Type val)fn Type? BufferedChannel.pop(self)fn void? BufferedChannel.close(self)std::thread::cpu @if(env::DARWIN)
Section titled “std::thread::cpu @if(env::DARWIN)”fn uint native_cpu()std::thread::cpu @if(env::LINUX)
Section titled “std::thread::cpu @if(env::LINUX)”fn uint native_cpu()std::thread::cpu @if(env::WIN32)
Section titled “std::thread::cpu @if(env::WIN32)”fn uint native_cpu()std::thread::event
Section titled “std::thread::event”std::thread::os @if (!env::POSIX && !env::WIN32)
Section titled “std::thread::os @if (!env::POSIX && !env::WIN32)”typedef NativeMutex = inttypedef NativeTimedMutex = inttypedef NativeConditionVariable = inttypedef NativeOnceFlag = inttypedef NativeThread = intstd::thread::os @if(env::POSIX)
Section titled “std::thread::os @if(env::POSIX)”struct NativeMutexalias NativeTimedMutex = NativeMutexalias NativeConditionVariable = Pthread_cond_tstruct NativeThreadalias NativeOnceFlag = Pthread_once_tfn void? NativeMutex.init(&self, MutexType type)fn bool NativeMutex.is_initialized(&self)fn void? NativeMutex.destroy(&self)fn void? NativeMutex.lock(&self)fn void? NativeMutex.lock_timeout(&self, ulong ms)fn bool NativeMutex.try_lock(&self)fn void? NativeMutex.unlock(&self)fn void? NativeConditionVariable.init(&cond)fn void? NativeConditionVariable.destroy(&cond)fn void? NativeConditionVariable.signal(&cond)fn void? NativeConditionVariable.broadcast(&cond)fn void? NativeConditionVariable.wait(&cond, NativeMutex* mtx)fn void? NativeConditionVariable.wait_timeout(&cond, NativeMutex* mtx, ulong ms)fn void? NativeConditionVariable.wait_timeout_duration(&cond, NativeMutex* mtx, Duration duration)fn void? NativeConditionVariable.wait_until(&cond, NativeMutex* mtx, Time time)fn void? NativeThread.create(&thread, ThreadFn thread_fn, void* arg)fn void? NativeThread.detach(thread)fn void native_thread_exit(int result)fn NativeThread native_thread_current()fn bool NativeThread.equals(thread, NativeThread other)fn int? NativeThread.join(thread)fn void NativeOnceFlag.call_once(&flag, OnceFn func)fn void native_thread_yield()fn void? native_sleep_nano(NanoDuration nano)std::thread::os @if(env::WIN32)
Section titled “std::thread::os @if(env::WIN32)”typedef NativeThread = inline Win32_HANDLEstruct NativeMutexstruct NativeTimedMutexstruct NativeConditionVariablestruct NativeOnceFlagfn void? NativeMutex.init(&mtx, MutexType type)fn void? NativeMutex.destroy(&mtx)fn void? NativeMutex.lock(&mtx)fn bool NativeMutex.try_lock(&mtx)fn void? NativeMutex.unlock(&mtx)fn void? NativeTimedMutex.init(&mtx, MutexType type)fn void? NativeTimedMutex.destroy(&mtx)fn void? NativeTimedMutex.lock(&mtx)fn void? NativeTimedMutex.lock_timeout(&mtx, ulong ms)fn bool NativeTimedMutex.try_lock(&mtx)fn void? NativeTimedMutex.unlock(&mtx)fn void? NativeConditionVariable.init(&cond)fn void? NativeConditionVariable.destroy(&cond) @maydiscardfn void? NativeConditionVariable.signal(&cond)fn void? NativeConditionVariable.broadcast(&cond)fn void? NativeConditionVariable.wait(&cond, NativeMutex* mtx) @inlinefn void? NativeConditionVariable.wait_timeout(&cond, NativeMutex* mtx, ulong ms) @inlinefn void? NativeConditionVariable.wait_timeout_duration(&cond, NativeMutex* mtx, Duration duration) @inlinefn void? NativeConditionVariable.wait_until(&cond, NativeMutex* mtx, Time time) @inlinefn void? NativeThread.create(&thread, ThreadFn func, void* args)fn void? NativeThread.detach(thread) @inlinefn void native_thread_exit(int result) @inlinefn void native_thread_yield()fn void NativeOnceFlag.call_once(&flag, OnceFn func)fn int? NativeThread.join(thread)fn NativeThread native_thread_current()fn bool NativeThread.equals(thread, NativeThread other)fn void? native_sleep_nano(NanoDuration ns)std::thread::pool{SIZE}
Section titled “std::thread::pool{SIZE}”struct ThreadPoolfn void? ThreadPool.init(&self)fn void? ThreadPool.destroy(&self)fn void? ThreadPool.stop_and_destroy(&self)fn void? ThreadPool.push(&self, ThreadFn func, void* arg)std::thread::threadpool @if (env::POSIX || env::WIN32)
Section titled “std::thread::threadpool @if (env::POSIX || env::WIN32)”alias ThreadPoolFn = fn void(any[] args)struct FixedThreadPoolfn void? FixedThreadPool.init(&self, usz threads, usz queue_size = 0)fn void? FixedThreadPool.destroy(&self)fn void? FixedThreadPool.stop_and_destroy(&self)fn void? FixedThreadPool.push(&self, ThreadPoolFn func, args...)std::time
Section titled “std::time”typedef Time @structlike = longtypedef Duration @structlike = longtypedef Clock @structlike = ulongtypedef NanoDuration (Printable) @structlike = longfn Duration us(long l) @inlinefn Duration ms(long l) @inlinefn Duration sec(long l) @inlinefn Duration min(long l) @inlinefn Duration hour(long l) @inlinefn Duration from_float(double s) @inlinestruct DateTimestruct TzDateTimeenum Weekday : char (String name, String abbrev)enum Month : char (String name, String abbrev, int days, bool leap)fn Time now()fn Time Time.add_seconds(time, long seconds)fn Time Time.add_minutes(time, long minutes)fn Time Time.add_hours(time, long hours)fn Time Time.add_days(time, long days)fn Time Time.add_weeks(time, long weeks)fn Time Time.add_duration(time, Duration duration) @operator_s(+) @inlinefn Time Time.sub_duration(time, Duration duration) @operator(-) @inlinefn int Time.compare_to(time, Time other)fn double Time.to_seconds(time)fn Duration Time.diff_us(time, Time other) @operator(-)fn double Time.diff_sec(time, Time other)fn double Time.diff_min(time, Time other)fn double Time.diff_hour(time, Time other)fn double Time.diff_days(time, Time other)fn double Time.diff_weeks(time, Time other)fn double NanoDuration.to_sec(nd)fn long NanoDuration.to_ms(nd)fn Duration NanoDuration.to_duration(nd)fn NanoDuration Duration.to_nano(td)fn long Duration.to_ms(td)macro Duration Duration.mult(#td, long #val) @operator_s(*) @safemacrofn usz? NanoDuration.to_format(&self, Formatter* formatter) @dynamicstd::time::clock
Section titled “std::time::clock”fn Clock now()fn NanoDuration Clock.mark(&self)fn Clock Clock.add_nano_duration(self, NanoDuration nano) @operator_s(+) @inlinefn Clock Clock.sub_nano_duration(self, NanoDuration nano) @operator(-) @inlinefn Clock Clock.add_duration(self, Duration duration) @operator_s(+) @inlinefn Clock Clock.sub_duration(self, Duration duration) @operator(-) @inlinefn NanoDuration Clock.nano_diff(self, Clock other) @operator(-) @inlinefn NanoDuration Clock.to_now(self) @inlinestd::time::datetime @if(env::LIBC)
Section titled “std::time::datetime @if(env::LIBC)”fn DateTime now()fn DateTime from_date(int year, Month month = JANUARY, int day = 1, int hour = 0, int min = 0, int sec = 0, int us = 0)fn TzDateTime from_date_tz(int year, Month month = JANUARY, int day = 1, int hour = 0, int min = 0, int sec = 0, int us = 0, int gmt_offset = 0)fn TzDateTime DateTime.to_local(&self)fn TzDateTime DateTime.with_gmt_offset(self, int gmt_offset)fn TzDateTime TzDateTime.with_gmt_offset(self, int gmt_offset)fn TzDateTime DateTime.to_gmt_offset(self, int gmt_offset)fn TzDateTime TzDateTime.to_gmt_offset(self, int gmt_offset)fn void DateTime.set_date(&self, int year, Month month = JANUARY, int day = 1, int hour = 0, int min = 0, int sec = 0, int us = 0)fn void DateTime.set_time(&self, Time time)fn DateTime DateTime.add_us(&self, Duration d) @operator_s(+)fn DateTime DateTime.sub_us(&self, Duration d) @operator(-)fn DateTime DateTime.add_seconds(&self, int seconds)fn DateTime DateTime.add_minutes(&self, int minutes)fn DateTime DateTime.add_hours(&self, int hours)fn DateTime DateTime.add_days(&self, int days)fn DateTime DateTime.add_weeks(&self, int weeks)fn DateTime DateTime.add_years(&self, int years)fn DateTime DateTime.add_months(&self, int months)fn TzDateTime TzDateTime.add_us(&self, Duration d) @operator_s(+)fn TzDateTime TzDateTime.sub_us(&self, Duration d) @operator(-)fn TzDateTime TzDateTime.add_seconds(&self, int seconds)fn TzDateTime TzDateTime.add_minutes(&self, int minutes)fn TzDateTime TzDateTime.add_hours(&self, int hours)fn TzDateTime TzDateTime.add_days(&self, int days)fn TzDateTime TzDateTime.add_weeks(&self, int weeks)fn TzDateTime TzDateTime.add_years(&self, int years)fn TzDateTime TzDateTime.add_months(&self, int months)fn DateTime from_time(Time time)fn TzDateTime from_time_tz(Time time, int gmt_offset)fn Time DateTime.to_time(&self) @inlinefn bool DateTime.after(&self, DateTime compare) @inlinefn bool DateTime.before(&self, DateTime compare) @inlinefn int DateTime.compare_to(&self, DateTime compare)fn int DateTime.diff_years(&self, DateTime from)fn double DateTime.diff_sec(self, DateTime from)fn Duration DateTime.diff_us(self, DateTime from) @operator(-)enum DateTimeFormatfn String format(Allocator allocator, DateTimeFormat type, TzDateTime dt)fn String tformat(DateTimeFormat dt_format, TzDateTime dt)fn String TzDateTime.format(self, Allocator allocator, DateTimeFormat dt_format)fn String DateTime.format(self, Allocator allocator, DateTimeFormat dt_format)std::time::os @if(env::DARWIN)
Section titled “std::time::os @if(env::DARWIN)”fn Clock native_clock()std::time::os @if(env::POSIX)
Section titled “std::time::os @if(env::POSIX)”fn Time native_timestamp()fn Clock native_clock() @if(!env::DARWIN)std::time::os @if(env::WIN32)
Section titled “std::time::os @if(env::WIN32)”fn Clock native_clock()fn Time native_timestamp()