DittoConnection

public struct DittoConnection
extension DittoConnection: Identifiable
extension DittoConnection: Equatable
extension DittoConnection: Hashable
extension DittoConnection: Codable

Represents a connection between two peers on the Ditto mesh network.

  • id

    Unique identifier for the connection.

    Declaration

    Swift

    public var id: String
  • Type of transport enabling this connection.

    Declaration

    Swift

    public var type: DittoConnectionType
  • The peer key of the peer at one end of the connection.

    Declaration

    Swift

    public var peer1: Data
  • The peer key of the peer at the other end of the connection.

    Declaration

    Swift

    public var peer2: Data
  • Estimate of distance to the remote peer. This value is inaccurate. The environment, hardware, and several other factors can greatly affect this value. It is currently derived from RSSI.

    Declaration

    Swift

    public var approximateDistanceInMeters: Double?
  • Initialize a new connection.

    Declaration

    Swift

    public init(id: String, type: DittoConnectionType, peer1: Data, peer2: Data, approximateDistanceInMeters: Double? = nil)

Codable

  • Declaration

    Swift

    public init(from decoder: Decoder) throws