SDK Reference v2.0.0 / ScopedIdentifier
ScopedIdentifier
struct ScopedIdentifier<Subject, Value> : Hashable where Value : Hashable
A unique identifier associated with a specific model type (the Subject
) in MyDataHelps.
Most model types in this SDK have at least one identifier value, typically a string. It is an error
to use the identifier from a model of type A when fetching, querying, or updating models of type B.
ScopedIdentifiers prevent such mistakes by making it a compiler error to use a mismatched identifier.
See the Programming Guide for more information.
value
let value: Value
The value of the identifier.
init(_:)
init(_ value: Value)
Initializes an identifier.
Directly initializing a ScopedIdentifier is uncommon: typically, MyDataHelpsKit
will fetch model objects with existing identifiers from the server (e.g. via ParticipantSession
),
and the client will then use these existing identifiers in other API calls.
+ Parameters
value
The value of the identifier.