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.
Zig › std/ › Io/ › net/ › HostName.zig › enqueueConnection
enqueueConnection
HostName.enqueueConnection
fn enqueueConnection (
address : IpAddress ,
io : Io ,
queue : *Io .Queue (IpAddress .ConnectError !Stream ),
options : IpAddress .ConnectOptions ,
) Io .Cancelable !void
File
Code
fn enqueueConnection (
address : IpAddress ,
io : Io ,
queue : *Io .Queue (IpAddress .ConnectError !Stream ),
options : IpAddress .ConnectOptions ,
) Io .Cancelable !void {
const result = address .connect (io , options ) catch |err | switch (err ) {
error .Canceled => |e | return e ,
else => |e | e ,
};
errdefer if (result ) |s | s .close (io ) else |_ | {};
queue .putOne (io , result ) catch |err | switch (err ) {
error .Canceled => |e | return e ,
error .Closed => unreachable ,
};
}