Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

read

ico.read
pub fn read(allocator: std.mem.Allocator, reader: *std.Io.Reader, max_size: u64) ReadError!IconDir

File

Code

pub fn read(allocator: std.mem.Allocator, reader: *std.Io.Reader, max_size: u64) ReadError!IconDir {
    return readInner(allocator, reader, max_size) catch |err| switch (err) {
        error.OutOfMemory,
        error.InvalidHeader,
        error.InvalidImageType,
        error.ImpossibleDataSize,
        error.ReadFailed,
        => |e| return e,
        error.EndOfStream => error.UnexpectedEOF,
    };
}