IO Utilities API ​
Centralized in src/io/.
AnyIO ​
defaultIo()— returns the appropriatestd.Iofor test or runtime contextsleepMs(ms: u64)— sleep using the canonical IOsleepMsI(ms: i64)— sleep using the canonical IO (signed)AnyReader— type-erased reader withread,readByte,readNoEofAnyWriter— type-erased writer withwrite,writeAll,print
Buffer ​
Dynamic, growable byte buffer.
init(allocator, capacity)— create bufferappend(bytes)— append bytestoOwnedSlice()— return owned sliceclear()— reset without deallocatingdeinit()— release memory
FixedBuffer ​
Stack-allocated fixed-size buffer with no heap allocation.
zig
var buf = FixedBuffer(64){};BufferPool ​
Pre-allocated buffer pool with slot-based ownership tracking, acquire/release semantics, and detection of foreign/double-release buffers.
init(allocator, config)— create a poolacquire()— get a buffer from the poolrelease(buffer)— return a buffer to the poolstats()— get pool statistics (total, available, acquired, leaks, errors)deinit()— release all resources
Root-level alias: httpx.BufferPool.
Base64 ​
RFC 4648 base64 with standard and URL-safe alphabets.
encode(allocator, data)— encode to base64decode(allocator, data)— decode from base64encodeUrl(allocator, data)— URL-safe encoding
Hex ​
encode(allocator, data)— hex encodedecode(allocator, data)— hex decode
PercentEncoding ​
RFC 3986 URL encoding.
encode(allocator, input)— percent-encodedecode(allocator, input)— percent-decode
