def v4.parts

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

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

80def v4.parts(ps: List<&2, String>) -> Maybe<&2, U32>:
81  match ps:
82    case Con{a, Con{b, Con{c, Con{d, Nil{}}}}}:
83      do Maybe<&2, U32>:
84        w : U32 <- octet(a)
85        x : U32 <- octet(b)
86        y : U32 <- octet(c)
87        z : U32 <- octet(d)
88        return (w * 16777216 + x * 65536 + y * 256 + z : U32)
89    case _:
90      None{}

Uses (9)

Used by (1)