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 › Kqueue › await Private Function await Doc Source Private Function std.Io.Kqueue.await
fn await (
userdata : ?*anyopaque ,
any_future : *Io .AnyFuture ,
result : []u8 ,
result_alignment : std .mem .Alignment ,
) void Params userdata : ?*anyopaque any_future : *Io .AnyFuture result : []u8 result_alignment : std .mem .Alignment File Io/Kqueue.zig: 729
729
730
731
732
733
734
735
736
737
738
739
740
741 fn await (
userdata : ?*anyopaque ,
any_future : *Io .AnyFuture ,
result : []u8 ,
result_alignment : std .mem .Alignment ,
) void {
const k : *Kqueue = @ptrCast (@alignCast (userdata ));
const future_fiber : *Fiber = @ptrCast (@alignCast (any_future ));
if (@atomicLoad (?*Fiber , &future_fiber .awaiter , .acquire ) != Fiber .finished )
k .yield (null , .{ .register_awaiter = &future_fiber .awaiter });
@memcpy (result , future_fiber .resultBytes (result_alignment ));
k .recycle (future_fiber );
}