def Ip4.mask.go

bend-kube-runtime@0.2.0.0 · src/proxy.bend:73

import bend-kube-runtime@0.2.0.0/src/proxy.bend as Proxy
import Base

73# The mask of a prefix length; None past 32.
74def Ip4.mask.go(+bits: U32, ok: Bool) -> Maybe<&2, U32>:
75  match ok:
76    case True{}:
77      Some{U32.shln(4294967295, U32.to_nat(U32.sub(32, bits)))}
78    case False{}:
79      None{}

Uses (6)

Used by (1)