Target
public struct Target : Hashable
A struct that represents a network target. It consists of a hostname or an IP address and a port number.
-
The hostname or IP address of the target. The IP address can either be IPv4 or IPv6.
Declaration
Swift
public let hostname: String -
The port.
Declaration
Swift
public let port: UInt16 -
Initialize a target with a given hostname and port.
Declaration
Swift
public init?(withHostname hostname: String, andPort port: UInt16)Parameters
hostnameThe hostname or IP address.
portThe port
-
A string representation of the target.
Declaration
Swift
public func formatted() -> StringReturn Value
example.com:80if the hostname isexample.comand the port is 80.
View on GitHub
Target Structure Reference