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.

testDiscard

Create a Decompress from compressed and immediately discard all output. Returns the number of discarded bytes.

zstd.testDiscard
fn testDiscard(gpa: std.mem.Allocator, compressed: []const u8) !usize

File

Code

fn testDiscard(gpa: std.mem.Allocator, compressed: []const u8) !usize {
    const buf: []u8 = try gpa.alloc(u8, default_window_len + block_size_max);
    defer gpa.free(buf);

    var in: std.Io.Reader = .fixed(compressed);
    var zstd_stream: Decompress = .init(&in, buf, .{});
    return try zstd_stream.reader.discardRemaining();
}