def show

bend-kit-netip@0.1.0.0 · netip.bend:336

import bend-kit-netip@0.1.0.0/netip.bend as Netip
import Base

336# RFC 5952: lowercase, shortest hex groups, longest leftmost "::" run.
337def show(addr: Addr) -> String:
338  match addr:
339    case V4{w}:
340      v4.show(w)
341    case V6{+a, +b, +c, +d}:
342      v6.show.mapped(Bool.and(U32.is_zero(a), Bool.and(U32.is_zero(b), U32.is_eq(c, 65535))), a, b, c, d)

Uses (7)

Used by (1)