Zig 0.17.0 documentation
Language reference and standard library, in Chinese and English.
Introduction
6Language reference
53 chaptersFrom syntax, types, and memory semantics to compile-time execution and builtins.
- Introduction
- Zig Standard Library
- Hello World
- Comments
- Namespace
- Identifiers
- Values
- Zig Test
- Variables
- Integers
- Floats
- Operators
- Arrays
- Vectors
- Pointers
- Slices
- struct
- enum
- union
- opaque
- Blocks
- switch
- while
- for
- if
- defer
- unreachable
- noreturn
- Functions
- Errors
- Optionals
- Casting
- Zero Bit Types
- Result Location Semantics
- comptime
- Assembly
- Atomics
- Async Functions
- Builtin Functions
- Optimization Mode
- Single Threaded Builds
- Illegal Behavior
- Memory
- Compile Variables
- Compilation Model
- Zig Build System
- C
- WebAssembly
- Targets
- Style Guide
- Source Encoding
- Keyword Reference
- Appendix
Standard library
538 modulesExplore APIs, parameters, fields, errors, and source by module.
No matching modules
std.piestd.heap.PageAllocatorstd.heap.FixedBufferAllocatorstd.heap.SafeAllocatorstd.heap.SmpAllocatorstd.heap.BufferFirstAllocatorstd.heap.debug_allocatorstd.heap.ArenaAllocatorstd.heap.BrkAllocatorstd.heap.memory_poolstd.valgrindstd.fs.pathstd.Iostd.spirvstd.fsstd.osstd.hash.murmurstd.hash.fnvstd.hash.verifystd.hash.crc.Crc32cstd.hash.xxhashstd.hash.cityhashstd.hash.Adler32std.hash.benchmarkstd.hash.wyhashstd.hash.crcstd.hash.auto_hashstd.Threadstd.testingstd.math.bigstd.math.expo2std.math.log1pstd.math.iszerostd.math.isfinitestd.math.frexpstd.math.gammastd.math.isinfstd.math.powstd.math.nextafterstd.math.coshstd.math.complex.projstd.math.complex.sinstd.math.complex.argstd.math.complex.powstd.math.complex.coshstd.math.complex.tanstd.math.complex.expstd.math.complex.conjstd.math.complex.acoshstd.math.complex.acosstd.math.complex.atanhstd.math.complex.sqrtstd.math.complex.ldexpstd.math.complex.asinstd.math.complex.tanhstd.math.complex.cosstd.math.complex.logstd.math.complex.asinhstd.math.complex.absstd.math.complex.sinhstd.math.complex.atanstd.math.hypotstd.math.isnormalstd.math.isnanstd.math.expm1std.math.acoshstd.math.gcdstd.math.acosstd.math.atanhstd.math.signbitstd.math.floatstd.math.complexstd.math.sqrtstd.math.ldexpstd.math.big.intstd.math.asinstd.math.log_intstd.math.cbrtstd.math.powistd.math.log2std.math.scalbnstd.math.tanhstd.math.lcmstd.math.logstd.math.asinhstd.math.modfstd.math.ilogbstd.math.atan2std.math.sinhstd.math.atanstd.math.copysignstd.math.log10std.hashstd.dequestd.dwarf.ATstd.dwarf.FORMstd.dwarf.TAGstd.dwarf.LANGstd.dwarf.ATEstd.dwarf.EHstd.dwarf.OPstd.tar.Writerstd.c.openbsdstd.c.haikustd.c.serenitystd.c.darwin.dispatchstd.c.darwinstd.c.netbsdstd.c.freebsdstd.c.dragonflystd.c.illumosstd.json.Stringifystd.json.hashmapstd.json.Scannerstd.json.dynamicstd.json.staticstd.wasmstd.metastd.base64std.heapstd.Buildstd.jsonstd.lang.assemblystd.crypto.ml_dsastd.crypto.aes_sivstd.crypto.hkdfstd.crypto.cbc_macstd.crypto.25519.scalarstd.crypto.25519.curve25519std.crypto.25519.x25519std.crypto.25519.ristretto255std.crypto.25519.ed25519std.crypto.25519.fieldstd.crypto.25519.edwards25519std.crypto.pcurves.p384.p384_scalar_64std.crypto.pcurves.p384.scalarstd.crypto.pcurves.p384.p384_64std.crypto.pcurves.p384.fieldstd.crypto.pcurves.secp256k1std.crypto.pcurves.tests.secp256k1std.crypto.pcurves.tests.p256std.crypto.pcurves.tests.p384std.crypto.pcurves.commonstd.crypto.pcurves.p256std.crypto.pcurves.secp256k1.scalarstd.crypto.pcurves.secp256k1.secp256k1_scalar_64std.crypto.pcurves.secp256k1.secp256k1_64std.crypto.pcurves.secp256k1.fieldstd.crypto.pcurves.p256.p256_64std.crypto.pcurves.p256.scalarstd.crypto.pcurves.p256.fieldstd.crypto.pcurves.p256.p256_scalar_64std.crypto.pcurves.p384std.crypto.codecsstd.crypto.tlsstd.crypto.md5std.crypto.cmacstd.crypto.sha2std.crypto.modesstd.crypto.Certificatestd.crypto.salsa20std.crypto.aegisstd.crypto.aes.bitslicedstd.crypto.aes.softstd.crypto.aes.aesnistd.crypto.aes.armcryptostd.crypto.errorsstd.crypto.kangarootwelvestd.crypto.hybrid_kemstd.crypto.argon2std.crypto.ghash_polyvalstd.crypto.timing_safestd.crypto.blake2std.crypto.aes_gcmstd.crypto.aes_ocbstd.crypto.keccak_pstd.crypto.ffstd.crypto.sha3std.crypto.hash_compositionstd.crypto.aesstd.crypto.Certificate.Chainstd.crypto.Certificate.Bundlestd.crypto.Certificate.Bundle.macosstd.crypto.benchmarkstd.crypto.pbkdf2std.crypto.isapstd.crypto.chacha20std.crypto.tls.Clientstd.crypto.ml_kemstd.crypto.codecs.asn1std.crypto.codecs.base64_hex_ctstd.crypto.codecs.asn1.der.Decoderstd.crypto.codecs.asn1.der.ArrayListReversestd.crypto.codecs.asn1.der.Encoderstd.crypto.codecs.asn1.derstd.crypto.codecs.asn1.Oidstd.crypto.scryptstd.crypto.aes_gcm_sivstd.crypto.poly1305std.crypto.hmacstd.crypto.siphashstd.crypto.asconstd.crypto.phc_encodingstd.crypto.ecdsastd.crypto.aes_ccmstd.crypto.Sha1std.crypto.blake3std.crypto.bcryptstd.Progressstd.Randomstd.bit_setstd.dwarfstd.testing.FailingAllocatorstd.testing.Smithstd.leb128std.debug.Pdbstd.debug.MachOFilestd.debug.Dwarf.Unwind.VirtualMachinestd.debug.Dwarf.Unwindstd.debug.Dwarf.SelfUnwinderstd.debug.Dwarf.expressionstd.debug.no_panicstd.debug.Dwarfstd.debug.SelfInfo.MachOstd.debug.SelfInfo.Elfstd.debug.SelfInfo.Windowsstd.debug.Infostd.debug.Coveragestd.debug.cpu_contextstd.debug.ElfFilestd.debug.simple_panicstd.unicodestd.Io.Dirstd.Io.Filestd.Io.net.HostNamestd.Io.Kqueuestd.Io.fiberstd.Io.Readerstd.Io.Threadedstd.Io.netstd.Io.Dispatchstd.Io.Semaphorestd.Io.Reader.Limitedstd.Io.Uringstd.Io.RwLockstd.Io.Terminalstd.Io.Writerstd.Io.File.Readerstd.Io.File.MultiReaderstd.Io.File.MemoryMapstd.Io.File.Atomicstd.Io.File.Writerstd.buf_mapstd.mem.Allocatorstd.asciistd.http.ChunkParserstd.http.Serverstd.http.Clientstd.http.HeadParserstd.http.HeaderIteratorstd.zipstd.zigstd.priority_queuestd.BitStackstd.coffstd.DoublyLinkedListstd.Uristd.static_string_mapstd.cstd.time.epochstd.array_liststd.compressstd.atomicstd.process.Environstd.process.Childstd.process.Argsstd.process.Preopensstd.memstd.zig.AstGenstd.zig.systemstd.zig.tokenizerstd.zig.Serverstd.zig.Parsestd.zig.c_translation.builtinsstd.zig.c_translation.helpersstd.zig.parser_generated_oraclestd.zig.Clientstd.zig.system.openbsdstd.zig.system.linuxstd.zig.system.armstd.zig.system.NativePathsstd.zig.system.darwin.macosstd.zig.system.darwinstd.zig.system.netbsdstd.zig.system.freebsdstd.zig.system.windowsstd.zig.system.loongarchstd.zig.system.x86std.zig.BuiltinFnstd.zig.llvmstd.zig.PkgConfigstd.zig.TokenSmithstd.zig.Zoirstd.zig.parser_fuzzstd.zig.ZonGenstd.zig.Ast.Renderstd.zig.string_literalstd.zig.LibCInstallationstd.zig.WindowsSdkstd.zig.AstRlAnnotatestd.zig.Aststd.zig.ErrorBundlestd.zig.Zirstd.zig.LibCDirsstd.zig.targetstd.zig.primitivesstd.zig.llvm.irstd.zig.llvm.Builderstd.zig.llvm.bitcode_writerstd.zig.llvm.BitcodeReaderstd.zig.number_literalstd.langstd.mathstd.priority_dequeuestd.buf_setstd.SemanticVersionstd.sort.blockstd.sort.pdqstd.debugstd.hash_mapstd.httpstd.Random.Isaac64std.Random.Pcgstd.Random.Sfc64std.Random.ChaChastd.Random.Xoshiro256std.Random.Xoroshiro128std.Random.Asconstd.Random.benchmarkstd.Random.SplitMix64std.Random.RomuTriostd.Random.lcgstd.Random.zigguratstd.sortstd.meta.trailer_flagsstd.startstd.array_hash_mapstd.os.uefistd.os.linuxstd.os.windows.crypt32std.os.windows.win32errorstd.os.windows.ws2_32std.os.windows.tlsstd.os.windows.ntdllstd.os.windows.kernel32std.os.windows.ntstatusstd.os.windows.langstd.os.windows.nlsstd.os.windows.sublangstd.os.wasistd.os.emscriptenstd.os.linux.microblazestd.os.linux.seccompstd.os.linux.riscv32std.os.linux.m68kstd.os.linux.shstd.os.linux.hexagonstd.os.linux.riscv64std.os.linux.loongarch64std.os.linux.loongarch32std.os.linux.tlsstd.os.linux.x32std.os.linux.mipsn32std.os.linux.bpf.helpersstd.os.linux.bpf.btfstd.os.linux.bpf.kernstd.os.linux.bpf.btf_extstd.os.linux.ioctlstd.os.linux.powerpcstd.os.linux.armstd.os.linux.mipsstd.os.linux.bpfstd.os.linux.arcstd.os.linux.sparcstd.os.linux.thumbstd.os.linux.or1kstd.os.linux.alphastd.os.linux.io_uring_sqestd.os.linux.syscallsstd.os.linux.x86_64std.os.linux.cskystd.os.linux.s390xstd.os.linux.sparc64std.os.linux.powerpc64std.os.linux.x86std.os.linux.IoUringstd.os.linux.vdsostd.os.linux.xtensastd.os.linux.aarch64std.os.linux.mips64std.os.plan9.x86_64std.os.windowsstd.os.plan9std.os.uefi.tablesstd.os.uefi.tables.boot_servicesstd.os.uefi.tables.table_headerstd.os.uefi.tables.runtime_servicesstd.os.uefi.tables.system_tablestd.os.uefi.tables.configuration_tablestd.os.uefi.device_pathstd.os.uefi.pool_allocatorstd.os.uefi.hiistd.os.uefi.protocolstd.os.uefi.protocol.simple_text_inputstd.os.uefi.protocol.hii_popupstd.os.uefi.protocol.shell_parametersstd.os.uefi.protocol.ip6_configstd.os.uefi.protocol.device_pathstd.os.uefi.protocol.absolute_pointerstd.os.uefi.protocol.ip6std.os.uefi.protocol.hii_databasestd.os.uefi.protocol.loaded_imagestd.os.uefi.protocol.edidstd.os.uefi.protocol.simple_text_input_exstd.os.uefi.protocol.simple_networkstd.os.uefi.protocol.graphics_outputstd.os.uefi.protocol.service_bindingstd.os.uefi.protocol.serial_iostd.os.uefi.protocol.udp6std.os.uefi.protocol.simple_file_systemstd.os.uefi.protocol.simple_pointerstd.os.uefi.protocol.managed_networkstd.os.uefi.protocol.simple_text_outputstd.os.uefi.protocol.filestd.os.uefi.protocol.rngstd.os.uefi.protocol.block_iostd.os.uefi.statusstd.zonstd.pdbstd.Targetstd.timestd.Target.m68kstd.Target.hexagonstd.Target.spirvstd.Target.lanaistd.Target.wasmstd.Target.xcorestd.Target.vestd.Target.powerpcstd.Target.kvxstd.Target.armstd.Target.propellerstd.Target.mipsstd.Target.bpfstd.Target.arcstd.Target.sparcstd.Target.alphastd.Target.msp430std.Target.hppastd.Target.cskystd.Target.s390xstd.Target.riscvstd.Target.loongarchstd.Target.nvptxstd.Target.x86std.Target.avrstd.Target.amdgcnstd.Target.genericstd.Target.Querystd.Target.xtensastd.Target.aarch64std.fmt.parse_float.convert_faststd.fmt.parse_float.convert_eisel_lemirestd.fmt.parse_float.commonstd.fmt.parse_float.parsestd.fmt.parse_float.FloatInfostd.fmt.parse_float.convert_hexstd.fmt.parse_float.convert_slowstd.fmt.parse_float.FloatStreamstd.fmt.parse_float.decimalstd.fmt.floatstd.fmt.parse_floatstd.compress.flate.Decompressstd.compress.flate.tokenstd.compress.flate.Compressstd.compress.lzma2std.compress.xz.Decompressstd.compress.xzstd.compress.lzmastd.compress.flatestd.compress.zstd.Decompressstd.compress.zstdstd.cryptostd.fmtstd.logstd.treapstd.valgrind.cachegrindstd.valgrind.callgrindstd.valgrind.memcheckstd.enumsstd.zon.stringifystd.zon.Serializerstd.zon.parsestd.posixstd.tarstd.machostd.processstd.multi_array_liststdstd.Build.Step.UpdateSourceFilesstd.Build.Step.WriteFilestd.Build.Step.CheckFilestd.Build.Step.TranslateCstd.Build.Step.Optionsstd.Build.Step.InstallArtifactstd.Build.Step.ObjCopystd.Build.Step.FindProgramstd.Build.Step.Runstd.Build.Step.InstallDirstd.Build.Step.Fmtstd.Build.Step.Compilestd.Build.Step.ConfigHeaderstd.Build.Step.Failstd.Build.Step.InstallFilestd.Build.Cache.Pathstd.Build.Cache.Directorystd.Build.Cache.DepTokenizerstd.Build.Cachestd.Build.Stepstd.Build.Serializestd.Build.Configurationstd.Build.abistd.Build.Modulestd.SinglyLinkedListstd.simdstd.dynamic_librarystd.elfstd.tz