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 standard library.
std › Io › Dispatch › operate Private Function operate Doc Source Private Function std.Io.Dispatch.operate
fn operate (userdata : ?*anyopaque , operation : Io .Operation ) Io .Cancelable !Io .Operation .Result Params userdata : ?*anyopaque operation : Io .Operation File Io/Dispatch.zig: 1692
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718 fn operate (userdata : ?*anyopaque , operation : Io .Operation ) Io .Cancelable !Io .Operation .Result {
const ev : *Evented = @ptrCast (@alignCast (userdata ));
switch (operation ) {
.file_read_streaming => |o | return .{
.file_read_streaming = ev .fileReadStreaming (o .file , o .data ) catch |err | switch (err ) {
error .Canceled => |e | return e ,
else => |e | e ,
},
},
.file_write_streaming => |o | return .{
.file_write_streaming = ev .fileWriteStreaming (
o .file ,
o .header ,
o .data ,
o .splat ,
) catch |err | switch (err ) {
error .Canceled => |e | return e ,
else => |e | e ,
},
},
.device_io_control => |*o | return .{ .device_io_control = try deviceIoControl (o ) },
.net_receive => @panic ("TODO implement net_receive operation" ),
.net_send => @panic ("TODO implement net_send operation" ),
.net_read => @panic ("TODO implement net_read operation" ),
.net_write => @panic ("TODO implement net_write operation" ),
}
}