Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Development · Evolving reference

Endpoint

Owns one numeric address and host-order port without native layout assumptions. Copying creates an independent fixed-size value. Construction never resolves names, opens a socket, allocates or validates remote reachability. Port zero represents an ephemeral local binding request; connection operations validate their own remote port requirements. Concurrent readonly access is safe while the value is not replaced or moved. No borrowed external storage is retained.

Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →

Module std.net

import std.net;

Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.

Endpoint

pub struct Endpoint

Owns one numeric address and host-order port without native layout assumptions. Copying creates an independent fixed-size value. Construction never resolves names, opens a socket, allocates or validates remote reachability. Port zero represents an ephemeral local binding request; connection operations validate their own remote port requirements. Concurrent readonly access is safe while the value is not replaced or moved. No borrowed external storage is retained.

Endpoint.Create

pub static fn Create(Address: Address, Port: u16) -> Endpoint

Copies exact numeric endpoint values without opening resources. Address: Owned copied IPv4/IPv6 value including scope. Port: Host-order port; zero remains representable for local binding. Return: Independent Data endpoint; no allocation, lookup or I/O.

Endpoint.Address

pub Address: Address;

Observes an independent address copy, preserving scope. Return: Owned numeric address; no allocation or I/O.

Endpoint.Port

pub Port: u16;

Observes the host-order port without conversion or validation. Return: Exact configured u16 port.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library