Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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. Private Function

address4FromPosix

Private Function
std.Io.Threaded.address4FromPosix
fn address4FromPosix(in: *const posix.sockaddr.in) net.Ip4Address

Params

  • in: *const posix.sockaddr.in

File

Io/Threaded.zig:14315
14315
14316
14317
14318
14319
14320
14321
14322
fn address4FromPosix(in: *const posix.sockaddr.in) net.Ip4Address {
    // The network byte order address in `in.addr` is already the byte order we want.
    const addr_bytes: *const [4]u8 = @ptrCast(&in.addr);
    return .{
        .port = std.mem.bigToNative(u16, in.port),
        .bytes = addr_bytes.*,
    };
}