OxL Reference

method SocketAddr.toString

ip:port for IPv4, [ip]:port for IPv6.

Example:

oxl✓ checked in CI
use std.net { SocketAddr }

fn main() io {
  print(SocketAddr.parse("[::1]:80")!.toString())
}
Output
[::1]:80
pub(api) fn toString() -> str

Since. 1.0.0-beta

Returns

str

Effects

none declared (pure unless the body says otherwise)

Defined in: std/net/net.oxl:326

See also