Represents an IPv4 address backed by a 32-bit unsigned integer (UInt32).
Provides zero-allocation arithmetic, comparison, and formatting.
Constructors
Creates an IPv4Address from an Ipconv::IPv4 struct.
SourceInitializes an IPv4Address from a raw 32-bit integer.
Sourceparse(str :
String) :
IPv4Address Parses a dot-decimal string representation into an IPv4Address.
Raises ArgumentError if the format is invalid or octets are out of range 0..255.
SourceInstance methods
+(other :
Int) :
IPv4Address Adds an integer offset to this address, returning a new IPv4Address.
Raises OverflowError if the resulting address is out of 32-bit address space.
Source-(other :
Int) :
IPv4Address Subtracts an integer offset from this address.
Source-(other :
IPv4Address) :
Int64 Computes the distance (number of addresses) between two IPv4Address values.
Source<=>(other :
IPv4Address) :
Int32 Compares this IPv4Address with another based on raw integer values.
Sourceclassify
Returns the classful networking designation (Class A, B, C, D, or E).
Sourceoctets
Decomposes the address into a 4-element tuple of 8-bit unsigned octets.
Sourcespecial
Returns the IANA special-purpose designation (e.g. Private, Loopback, Multicast).
Sourceto_ipconv
Converts this IPv4Address into an Ipconv::IPv4 representation.
SourceOutputs canonical dot-decimal format (e.g. "192.168.1.1") to the given IO.
Source