struct TraitDecoder
Public interface for decoding Trait data.
-
Undocumented
Declaration
Swift
@_spi(Unknown) var traitPayload: TraitPayload? { get }
-
Undocumented
Declaration
Swift
@_spi(Unknown) init(payload: TraitPayload) throws
-
Undocumented
Declaration
Swift
func unwrapPayload(namespace: [UInt32]) throws -> TraitDecoder
-
Deocdes an enum with a fallback value. The fallback value is returned if the tag is not available. If the tag is available but the decoding fails, the fallback value is NOT used, an error is thrown instead.
-
Undocumented
Declaration
Swift
func decode<T>(tag: TagID, type: T.Type = T.self) throws -> T where T : StructDataRepresentable
-
Undocumented
Declaration
Swift
func decodeArray<T>(tag: TagID, type: T.Type = T.self) throws -> [T] where T : StructDataRepresentable
-
Undocumented
Declaration
Swift
func decodeOptional<T>(tag: TagID, type: T.Type = T.self) throws -> T? where T : StructDataRepresentable
-
Undocumented
Declaration
Swift
func decodeOptionalArray<T>(tag: TagID, type: T.Type = T.self) throws -> [T]? where T : StructDataRepresentable
-
Undocumented
Declaration
Swift
func decodeMap<K, V>(tag: TagID, keyType: K.Type = K.self, valueType: V.Type = V.self) throws -> [K : V] where K : Scalar, V : StructDataRepresentable
-
Undocumented
Declaration
Swift
func decodeOptionalMap<K, V>(tag: TagID, keyType: K.Type = K.self, valueType: V.Type = V.self) throws -> [K : V]? where K : Scalar, V : StructDataRepresentable
-
Returns the default value for any type that’s DefaultConstructible.
Declaration
Swift
static func defaultValue<T>(type: T.Type = T.self) -> T where T : DefaultConstructible
-
Returns an empty array as the default value for any array types.
Declaration
Swift
static func defaultValue<T>(type: [T].Type = [T].self) -> [T]
-
Returns an empty dictionary as the default value for any dictionary types.
Declaration
Swift
static func defaultValue<K, V>(typeK: K.Type = K.self, typeV: V.Type = V.self) -> [K : V] where K : Hashable
-
Returns 0 (no bits set) the default value for any Bitmap types.
Declaration
Swift
static func defaultValue<T>(type: T.Type = T.self) -> T where T : Bitmap
-
Returns .unrecognizedCase() as the default value for any Enum types.
Declaration
Swift
static func defaultValue<T>(type: T.Type = T.self) -> T where T : Enum