type net/netip.Prefix
39 uses
net/netip (current package)
netip.go#L677: func (ip Addr) Prefix(b int) (Prefix, error) {
netip.go#L679: return Prefix{}, errors.New("negative Prefix bits")
netip.go#L684: return Prefix{}, nil
netip.go#L687: return Prefix{}, errors.New("prefix length " + itoa.Itoa(b) + " too large for IPv4")
netip.go#L692: return Prefix{}, errors.New("prefix length " + itoa.Itoa(b) + " too large for IPv6")
netip.go#L1288: type Prefix struct {
netip.go#L1304: func PrefixFrom(ip Addr, bits int) Prefix {
netip.go#L1309: return Prefix{
netip.go#L1316: func (p Prefix) Addr() Addr { return p.ip }
netip.go#L1321: func (p Prefix) Bits() int { return int(p.bitsPlusOne) - 1 }
netip.go#L1326: func (p Prefix) IsValid() bool { return p.bitsPlusOne > 0 }
netip.go#L1328: func (p Prefix) isZero() bool { return p == Prefix{} }
netip.go#L1331: func (p Prefix) IsSingleIP() bool { return p.IsValid() && p.Bits() == p.ip.BitLen() }
netip.go#L1341: func (p Prefix) compare(p2 Prefix) int {
netip.go#L1367: func ParsePrefix(s string) (Prefix, error) {
netip.go#L1370: return Prefix{}, parsePrefixError{in: s, msg: "no '/'"}
netip.go#L1374: return Prefix{}, parsePrefixError{in: s, msg: err.Error()}
netip.go#L1378: return Prefix{}, parsePrefixError{in: s, msg: "IPv6 zones cannot be present in a prefix"}
netip.go#L1385: return Prefix{}, parsePrefixError{in: s, msg: "bad bits after slash: " + strconv.Quote(bitsStr)}
netip.go#L1390: return Prefix{}, parsePrefixError{in: s, msg: "bad bits after slash: " + strconv.Quote(bitsStr)}
netip.go#L1397: return Prefix{}, parsePrefixError{in: s, msg: "prefix length out of range"}
netip.go#L1404: func MustParsePrefix(s string) Prefix {
netip.go#L1416: func (p Prefix) Masked() Prefix {
netip.go#L1428: func (p Prefix) Contains(ip Addr) bool {
netip.go#L1458: func (p Prefix) Overlaps(o Prefix) bool {
netip.go#L1494: func (p Prefix) AppendTo(b []byte) []byte {
netip.go#L1521: func (p Prefix) AppendText(b []byte) ([]byte, error) {
netip.go#L1528: func (p Prefix) MarshalText() ([]byte, error) {
netip.go#L1545: func (p *Prefix) UnmarshalText(text []byte) error {
netip.go#L1547: *p = Prefix{}
netip.go#L1558: func (p Prefix) AppendBinary(b []byte) ([]byte, error) {
netip.go#L1569: func (p Prefix) MarshalBinary() ([]byte, error) {
netip.go#L1576: func (p *Prefix) UnmarshalBinary(b []byte) error {
netip.go#L1590: func (p Prefix) String() string {
net
addrselect.go#L211: Prefix netip.Prefix