WebURL Documentation Beta

Structure IPv6Address

public struct IPv6Address 

A 128-bit numerical identifier assigned to a device on an Internet Protocol, version 6 network.

Conforms To

Codable
Equatable
Hashable
LosslessStringConvertible

Nested Type Aliases

Octets

public typealias Octets = (
  UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8,
  UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8
)

Pieces

public typealias Pieces = (UInt16, UInt16, UInt16, UInt16, UInt16, UInt16, UInt16, UInt16)

Initializers

init(octets:​)

@inlinable
public init(octets: Octets = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) 

Creates an address with the given octets.

init(pieces:​_:​)

@inlinable
public init(pieces: Pieces, _ octetArrangement: OctetArrangement) 

Creates an address from the given 16-bit integer pieces.

Parameters

pieces Pieces

The integer pieces of the address.

octet​Arrangement Octet​Arrangement

How the octets in each integer of pieces are arranged:

  • If numeric, the integers are assumed to be in "host byte order", and their octets will be rearranged if necessary.
  • If binary, the integers are assumed to be in "network byte order", and their octets will be stored in the order they are in.

init(from:​)

public init(from decoder: Decoder) throws 

init?(_:​)

@inlinable @inline(__always)
public init?<S>(_ description: S) where S: StringProtocol 

Parses an IPv6 address from a String.

Accepted formats are documented in Section 2.2 ("Text Representation of Addresses") of IP Version 6 Addressing Architecture (RFC 4291).

Parameters

description S

The string to parse.

init?(utf8:​)

@inlinable @inline(__always)
public init?<UTF8Bytes>(utf8: UTF8Bytes) where UTF8Bytes: Collection, UTF8Bytes.Element == UInt8 

Parses an IPv6 address from a collection of UTF-8 code-units.

Accepted formats are documented in Section 2.2 ("Text Representation of Addresses") of IP Version 6 Addressing Architecture (RFC 4291).

Parameters

utf8 UTF8Bytes

The string to parse, as a collection of UTF-8 code-units.

Properties

octets

public var octets: Octets

The octets of this address.

description

@inlinable
public var description: String 

serialized

public var serialized: String 

The canonical textual representation of this address, as defined by RFC 5952.

Methods

hash(into:​)

@inlinable
public func hash(into hasher: inout Hasher) 

encode(to:​)

public func encode(to encoder: Encoder) throws 

Operators

==

@inlinable
public static func == (lhs: Self, rhs: Self) -> Bool