protocol StructDataRepresentable : AutomationValueextension StructDataRepresentable : Equatable, Hashable, SendableSerializable abstraction for Structure data objects.
-
Creates a new Struct instance using data read from the given
TraitDecoder.Throws
HomeError.parseErrorwhen parsing fails.Declaration
Swift
init(decoder: TraitDecoder) throwsParameters
decoderThe raw data representing this Struct.
-
Writes this Struct to the given
TraitEncoder. ThrowsHomeError.parseErrorif the data could not be encoded.Declaration
Swift
func encode(with encoder: TraitEncoder) throws -
Default implementationstructField(id:)
Returns the field corresponding to the given field ID.
Default Implementation
Returns the field corresponding to the given field ID.
Declaration
Swift
static func structField(id: UInt32) -> (any Field)? -
Default implementationinit(fields:)
Creates a new Struct instance using the given dictionary of field/value pairs.
Default Implementation
Creates a new Struct instance using the given dictionary of field/value pairs.
Declaration
Swift
@_spi(Unknown) init?(fields: [AnyField : AnyAutomationValue])Parameters
fieldsThe list of fields representing this Struct.
-
Default implementationtoFields()
Serializes this Struct to a dictionary of
AnyField/AnyAutomationValuepairs that can be used for serialization in the Automation SDK.Default Implementation
Serializes this Struct to a dictionary of
AnyField/AnyAutomationValuepairs that can be used for serialization in the Automation SDK.Declaration
Swift
@_spi(Unknown) func toFields() -> [AnyField : AnyAutomationValue] -
Extension methodisEqual(to:)
Undocumented
Declaration
Swift
func isEqual(to other: any StructDataRepresentable) -> Bool