ABSTRACT

This chapter discusses enumerations (enums) and matches control flow operator. It covers concise control flow with if let. Two primary standards are now in use for IP addresses: version four (IPv4) and version six (IPv6). Any IP address can be either version four or version six, but not both at once. The enum data structure is appropriate because enum values can only be one of the several types of IP addresses. Because both version four and version six addresses are fundamentally IP addresses, they should be handled as the same type when the code is dealing with situations involving any sort of IP address.