type net/netip.Prefix
33 uses
net/netip (current package)
netip.go#L650: func (ip Addr) Prefix(b int) (Prefix, error) {
netip.go#L652: return Prefix{}, errors.New("negative Prefix bits")
netip.go#L657: return Prefix{}, nil
netip.go#L660: return Prefix{}, errors.New("prefix length " + itoa.Itoa(b) + " too large for IPv4")
netip.go#L665: return Prefix{}, errors.New("prefix length " + itoa.Itoa(b) + " too large for IPv6")
netip.go#L1236: type Prefix struct {
netip.go#L1261: func PrefixFrom(ip Addr, bits int) Prefix {
netip.go#L1266: return Prefix{
netip.go#L1273: func (p Prefix) Addr() Addr { return p.ip }
netip.go#L1278: func (p Prefix) Bits() int { return int(p.bits) }
netip.go#L1283: func (p Prefix) IsValid() bool { return !p.ip.isZero() && p.bits >= 0 && int(p.bits) <= p.ip.BitLen() }
netip.go#L1285: func (p Prefix) isZero() bool { return p == Prefix{} }
netip.go#L1288: func (p Prefix) IsSingleIP() bool { return p.bits != 0 && int(p.bits) == p.ip.BitLen() }
netip.go#L1295: func ParsePrefix(s string) (Prefix, error) {
netip.go#L1298: return Prefix{}, errors.New("netip.ParsePrefix(" + strconv.Quote(s) + "): no '/'")
netip.go#L1302: return Prefix{}, errors.New("netip.ParsePrefix(" + strconv.Quote(s) + "): " + err.Error())
netip.go#L1307: return Prefix{}, errors.New("netip.ParsePrefix(" + strconv.Quote(s) + ": bad bits after slash: " + strconv.Quote(bitsStr))
netip.go#L1314: return Prefix{}, errors.New("netip.ParsePrefix(" + strconv.Quote(s) + ": prefix length out of range")
netip.go#L1321: func MustParsePrefix(s string) Prefix {
netip.go#L1333: func (p Prefix) Masked() Prefix {
netip.go#L1337: return Prefix{}
netip.go#L1347: func (p Prefix) Contains(ip Addr) bool {
netip.go#L1377: func (p Prefix) Overlaps(o Prefix) bool {
netip.go#L1413: func (p Prefix) AppendTo(b []byte) []byte {
netip.go#L1441: func (p Prefix) MarshalText() ([]byte, error) {
netip.go#L1458: func (p *Prefix) UnmarshalText(text []byte) error {
netip.go#L1460: *p = Prefix{}
netip.go#L1471: func (p Prefix) MarshalBinary() ([]byte, error) {
netip.go#L1479: func (p *Prefix) UnmarshalBinary(b []byte) error {
netip.go#L1493: func (p Prefix) String() string {