Initializerswift-ip 0.3.0IP
init(_:)
Parses an IPv4 address from a string in dotted-decimal notation.
init?(_ description: some StringProtocol)
Parses an IPv4 address from a string in dotted-decimal notation.
init?(_ description: some StringProtocol)
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 V4
An IPv4 address, which is 32 bits wide.
@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.
init(_ a: UInt8, _ b: UInt8, _ c: UInt8, _ d: UInt8)
init(storage: UInt32)
Creates an IPv4 address by wrapping a raw big-endian integer.
static var localhost: `Self` { get }
Returns the most common loopback address, 127.0.0.1
. Most people reaching for this API actually want IP.Block.loopback
, which models the entire loopback range.
var description: String { get }
Formats the address as a string in dotted-decimal notation.
var storage: UInt32
The raw address, in big-endian byte order.