<(_:_:)
Compares two IP addresses by their logical value
.
static func < (a: Self, b: Self) -> Bool
Compares two IP addresses by their logical value
.
static func < (a: Self, b: Self) -> Bool
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.
@frozen enum IP
The namespace for IP types.
var value: Storage { get }
The logical value of the address.
@frozen struct Bool
A value type whose instances are either true
or false
.
static func < (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.
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.
func onesMasked(to bits: UInt8) -> Self
Replaces all bits in the IP address except for the leading number of bits
with 1.
func zeroMasked(to bits: UInt8) -> Self
Replaces all bits in the IP address except for the leading number of bits
with 0.