The logical value of the address.
var value: Storage { get }
s2IPAAO7AddressPAAE5value7StorageQzvp
83N98
For IPv4, the high byte of the UInt32 is the first octet.
UInt32
For IPv6, the high bits of the UInt128 come from the high bits of the first hextet.
UInt128
import IP
This Foundation-free module provides tools for parsing and formatting IP addresses, and data structures for performing efficient IP address lookups.
protocol Address : Comparable, Hashable, LosslessStringConvertible, Sendable
Abstracts over IP.V4 and IP.V6 addresses.
IP.V4
IP.V6
@frozen enum IP
The namespace for IP types.
associatedtype Storage : BitwiseCopyable, FixedWidthInteger, UnsignedInteger
The raw storage type for the IP address.
@frozen struct UInt32
A 32-bit unsigned integer value type.
@frozen struct UInt128
A 128-bit unsigned integer type.
init(value: Storage)
Initializes an IP address from a logical value.
static func / (self: Self, bits: UInt8) -> IP.Block<Self>
Creates a CIDR block by masking this IP address to the specified number of bits. The meaning of the slash (/) operator follows CIDR notation.
/
static func < (a: Self, b: Self) -> Bool
Compares two IP addresses by their logical value.
value
func onesMasked(to bits: UInt8) -> Self
Replaces all bits in the IP address except for the leading number of bits with 1.
bits
func zeroMasked(to bits: UInt8) -> Self
Replaces all bits in the IP address except for the leading number of bits with 0.