ObjectSnapshot
@dynamicMemberLookup
public struct ObjectSnapshot<O> : ObjectRepresentation, Hashable where O : DynamicObject
extension ObjectSnapshot: CustomDebugStringConvertible, CoreStoreDebugStringConvertible
The ObjectSnapshot
is a full copy of a DynamicObject
‘s properties at a given point in time. This is useful especially when keeping thread-safe state values, in ViewModels for example. Since this is a value type, any changes in this struct
does not affect the actual object.
-
Declaration
Swift
public func objectID() -> O.ObjectID
-
Declaration
Swift
public func cs_dataStack() -> DataStack?
-
Declaration
Swift
public typealias ObjectType = O
-
Declaration
Swift
public func asPublisher(in dataStack: DataStack) -> ObjectPublisher<O>
-
Declaration
Swift
public func asReadOnly(in dataStack: DataStack) -> O?
-
Declaration
Swift
public func asEditable(in transaction: BaseDataTransaction) -> O?
-
Declaration
Swift
public func asSnapshot(in dataStack: DataStack) -> ObjectSnapshot<O>?
-
Declaration
Swift
public func asSnapshot(in transaction: BaseDataTransaction) -> ObjectSnapshot<O>?
-
Declaration
Swift
public static func == (lhs: `Self`, rhs: `Self`) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public var debugDescription: String { get }
-
Returns the value for the property identified by a given key.
Declaration
Swift
public subscript<V>(dynamicMember member: KeyPath<O, V>) -> V! where V : AllowedObjectiveCKeyPathValue { get set }
-
Returns the value for the property identified by a given key.
Declaration
Swift
public subscript<OBase, V>(dynamicMember member: KeyPath<O, FieldContainer<OBase>.Stored<V>>) -> V where OBase : CoreStoreObject, V : FieldStorableType { get set }
-
Returns the value for the property identified by a given key.
Declaration
Swift
public subscript<OBase, V>(dynamicMember member: KeyPath<O, FieldContainer<OBase>.Virtual<V>>) -> V where OBase : CoreStoreObject { get set }
-
Returns the value for the property identified by a given key.
Declaration
Swift
public subscript<OBase, V>(dynamicMember member: KeyPath<O, FieldContainer<OBase>.Coded<V>>) -> V where OBase : CoreStoreObject { get set }
-
Returns the value for the property identified by a given key.
Declaration
Swift
public subscript<OBase, V>(dynamicMember member: KeyPath<O, FieldContainer<OBase>.Relationship<V>>) -> V.PublishedType where OBase : CoreStoreObject, V : FieldRelationshipType { get set }
-
Returns the value for the property identified by a given key.
Declaration
Swift
public subscript<OBase, V>(dynamicMember member: KeyPath<O, ValueContainer<OBase>.Required<V>>) -> V where OBase : CoreStoreObject, V : ImportableAttributeType { get set }
-
Returns the value for the property identified by a given key.
Declaration
Swift
public subscript<OBase, V>(dynamicMember member: KeyPath<O, ValueContainer<OBase>.Optional<V>>) -> V? where OBase : CoreStoreObject, V : ImportableAttributeType { get set }
-
Returns the value for the property identified by a given key.
Declaration
Swift
public subscript<OBase, V>(dynamicMember member: KeyPath<O, TransformableContainer<OBase>.Required<V>>) -> V where OBase : CoreStoreObject, V : NSCoding, V : NSCopying { get set }
-
Returns the value for the property identified by a given key.
Declaration
Swift
public subscript<OBase, V>(dynamicMember member: KeyPath<O, TransformableContainer<OBase>.Optional<V>>) -> V? where OBase : CoreStoreObject, V : NSCoding, V : NSCopying { get set }
-
Returns the value for the property identified by a given key.
Declaration
Swift
public subscript<OBase, D>(dynamicMember member: KeyPath<O, RelationshipContainer<OBase>.ToOne<D>>) -> ObjectPublisher<D>? where OBase : CoreStoreObject, D : CoreStoreObject { get set }
-
Returns the value for the property identified by a given key.
Declaration
Swift
public subscript<OBase, D>(dynamicMember member: KeyPath<O, RelationshipContainer<OBase>.ToManyOrdered<D>>) -> [ObjectPublisher<D>] where OBase : CoreStoreObject, D : CoreStoreObject { get set }
-
Returns the value for the property identified by a given key.
Declaration
Swift
public subscript<OBase, D>(dynamicMember member: KeyPath<O, RelationshipContainer<OBase>.ToManyUnordered<D>>) -> Set<ObjectPublisher<D>> where OBase : CoreStoreObject, D : CoreStoreObject { get set }