Netip.contains: def of bend-kit-netip@0.1.0.0 Import: import bend-kit-netip@0.1.0.0/netip.bend as Netip Lines 415-425 of bend-kit-netip@0.1.0.0/netip.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-netip@0.1.0.0/netip.bend&start_line=415&end_line=425 import Base # Address and prefix families must match. The supplied prefix address keeps its host bits. def contains(p: Prefix, addr: Addr) -> Bool: match p addr: case Prefix{V4{a}, +bits} V4{b}: Bool.and(U32.is_le(bits, 32), word.contains(a, b, bits)) case Prefix{V6{a, b, c, d}, +bits} V6{e, f, g, h}: Bool.and(U32.is_le(bits, 128), Bool.and(word.contains(a, e, leading(bits, 0)), Bool.and(word.contains(b, f, leading(bits, 32)), Bool.and(word.contains(c, g, leading(bits, 64)), word.contains(d, h, leading(bits, 96)))))) case _ _: False{} Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_le https://jend.leeeet.dev/definition.txt?path=bend-kit-netip@0.1.0.0/netip.bend&name=Addr https://jend.leeeet.dev/definition.txt?path=bend-kit-netip@0.1.0.0/netip.bend&name=Prefix https://jend.leeeet.dev/definition.txt?path=bend-kit-netip@0.1.0.0/netip.bend&name=leading https://jend.leeeet.dev/definition.txt?path=bend-kit-netip@0.1.0.0/netip.bend&name=word.contains