Structures

The following structures are available globally.

  • A type-erased Codable value.

    The AnyCodable type forwards encoding and decoding responsibilities

    to an underlying value, hiding its specific underlying type.

    You can encode or decode mixed-type values in dictionaries

    and other collections that require Encodable or Decodable conformance

    by declaring their contained type to be AnyCodable.

    See also

    AnyEncodable

    See also

    AnyDecodable

    See more

    Declaration

    Swift

    public struct AnyCodable : Codable
    extension AnyCodable: _AnyEncodable, _AnyDecodable
    extension AnyCodable: Equatable
    extension AnyCodable: Comparable
    extension AnyCodable: CustomStringConvertible
    extension AnyCodable: CustomDebugStringConvertible
    extension AnyCodable: ExpressibleByNilLiteral, ExpressibleByBooleanLiteral, ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral, ExpressibleByStringLiteral, ExpressibleByArrayLiteral, ExpressibleByDictionaryLiteral
  • A type-erased Decodable value.

    The AnyDecodable type forwards decoding responsibilities

    to an underlying value, hiding its specific underlying type.

    You can decode mixed-type values in dictionaries

    and other collections that require Decodable conformance

    by declaring their contained type to be AnyDecodable:

    let json = “”“

    {

    "boolean”: true,

    “integer”: 1,

    “double”: 3.14159265358979323846,

    “string”: “string”,

    “array”: [1, 2, 3],

    “nested”: {

    “a”: “alpha”,

    “b”: “bravo”,

    “c”: “charlie”

    }

    }

    “”“.data(using: .utf8)!

    let decoder = JSONDecoder()

    let dictionary = try! decoder.decode([String: AnyCodable].self, from: json)

    See more

    Declaration

    Swift

    public struct AnyDecodable : Decodable
    extension AnyDecodable: _AnyDecodable
    extension AnyDecodable: Equatable
    extension AnyDecodable: CustomStringConvertible
    extension AnyDecodable: CustomDebugStringConvertible
  • A type-erased Encodable value.

    The AnyEncodable type forwards encoding responsibilities

    to an underlying value, hiding its specific underlying type.

    You can encode mixed-type values in dictionaries

    and other collections that require Encodable conformance

    by declaring their contained type to be AnyEncodable:

    let dictionary: [String: AnyEncodable] = [

    “boolean”: true,

    “integer”: 1,

    “double”: 3.14159265358979323846,

    “string”: “string”,

    “array”: [1, 2, 3],

    “nested”: [

    “a”: “alpha”,

    “b”: “bravo”,

    “c”: “charlie”

    ]

    ]

    let encoder = JSONEncoder()

    let json = try! encoder.encode(dictionary)

    See more

    Declaration

    Swift

    public struct AnyEncodable : Encodable
    extension AnyEncodable: _AnyEncodable
    extension AnyEncodable: Equatable
    extension AnyEncodable: CustomStringConvertible
    extension AnyEncodable: CustomDebugStringConvertible
    extension AnyEncodable: ExpressibleByNilLiteral, ExpressibleByBooleanLiteral, ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral, ExpressibleByStringLiteral, ExpressibleByArrayLiteral, ExpressibleByDictionaryLiteral
  • Represents changes in the objects kept for lifecycle management by the ObjectLifecycleController. Changes are provided by the properties added, removed, or changed where exactly one is set and the others are not defined.

    See more

    Declaration

    Swift

    public struct ObjectLifecycleInfo

Additional type declarations.

  • Defines a rule for associating IO sources with IO actors.

    See more

    Declaration

    Swift

    public struct IoAssociationRule
  • Utility functions to cope with the Coaty compatible timestamp format. In Coaty, a timestamp defines the number of milliseconds elapsed since January 1, 1970, 00:00:00 UTC. In Swift, a Coaty timestamp should be represented as a Double value.

    See more

    Declaration

    Swift

    public struct CoatyTimestamp
  • A convenience struct used to define an IoNode

    See more

    Declaration

    Swift

    public struct IoNodeDefinition
  • An ObservedProperty specifies the phenomenon of an Observation.

    See more

    Declaration

    Swift

    public struct ObservedProperty : Codable

SensorDefinition.

  • Static definition of a sensor for use in SensorController.

    This is used in the options of the controller to register the sensors directly at creation. The sensors option of the SensorController should contain an array of SensorDefinitions.

    Each definition should contain the Sensor object, the hardware pin that it is connected to, and the type of the IO communication that it has.

    See more

    Declaration

    Swift

    public struct SensorDefinition

SensorContainer.

  • The registered sensors as they are used by the SensorController.

    This contains the Sensor object that is used for communication and the IO interface that defines the hardware connection and how the pin is read and written to.

    Declaration

    Swift

    public struct SensorContainer

RegisteredSensorsChangeInfo.

  • Represents change information when sensors are registered or deregistered.

    See more

    Declaration

    Swift

    public struct RegisteredSensorsChangeInfo
  • An object containing three key-value pairs:

    • The name property presents the full name of the unitOfMeasurement.
    • The symbol property shows the textual form of the unit symbol.
    • The definition contains the URI defining the unitOfMeasurement.

    The values of these properties SHOULD follow the Unified Code for Unit of Measure (UCUM).

    See more

    Declaration

    Swift

    public struct UnitOfMeasurement : Codable