Initializerswift-ip 0.3.0IP
init(_:)
Parses a CIDR block from a string in CIDR notation.
init?(_ string: some StringProtocol)
Parses a CIDR block from a string in CIDR notation.
init?(_ string: some StringProtocol)
where Base:IP.Address
import IP
This Foundation-free module provides tools for parsing and formatting IP addresses, and data structures for performing efficient IP address lookups.
@frozen struct Block<Base> where Base : IP.Address
A representation of a CIDR block.
@frozen enum IP
The namespace for IP types.
protocol StringProtocol : BidirectionalCollection, Comparable, ExpressibleByStringInterpolation, Hashable, LosslessStringConvertible, TextOutputStream, TextOutputStreamable where Self.Element == Character, Self.Index == String.Index, Self.StringInterpolation == DefaultStringInterpolation, Self.SubSequence : StringProtocol
A type that can represent a string as a collection of characters.
protocol Address : Comparable, Hashable, LosslessStringConvertible, Sendable
Abstracts over IP.V4
and IP.V6
addresses.
var description: String { get }
Formats the block as a string in CIDR notation.
var range: ClosedRange<Base> { get }
func contains(_ ip: Base) -> Bool