Domain
public struct Domain
Type that wraps a validated domain name (as per RFCs 952 and 1123)
The name of a Domain value should be considered safe for use in contexts which require a valid domain name, as any invalid domain formulations would be rejected by the contructor.
-
Domain formatting error.
See moreDeclaration
Swift
public enum Format : LocalizedError -
Domain size error.
See moreDeclaration
Swift
public enum Size : LocalizedError -
The validated domain name (as a
String).Declaration
Swift
public let name: String -
Creates a new
Domainvalue which wraps a validated domain name.And invalid
namecauses the constructor tothrow.“A ‘name’ (Net, Host, Gateway, or Domain name) is a text string … drawn from the alphabet (A-Z), digits (0-9), minus sign (-) … The first character must be an alpha character. The last character must not be a minus sign.”
and
“The restriction on the first character is relaxed to allow either a letter or a digit. Host software … SHOULD handle host names of up to 255 characters.”
Declaration
Swift
public init(name: String) throwsParameters
nameThe domain name to be wrapped (if validated).
View on GitHub
Install in Dash
Domain Structure Reference