# 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.

### AnyObjectRepresentation

- `objectID()`

  #### Declaration

  Swift

      public func objectID() -> O.ObjectID

- `cs_dataStack()`

  #### Declaration

  Swift

      public func cs_dataStack() -> DataStack?

### ObjectRepresentation

- `ObjectType`

  #### Declaration

  Swift

      public typealias ObjectType = O

- `asPublisher(in:)`

  #### Declaration

  Swift

      public func asPublisher(in dataStack: DataStack) -> ObjectPublisher<O>

- `asReadOnly(in:)`

  #### Declaration

  Swift

      public func asReadOnly(in dataStack: DataStack) -> O?

- `asEditable(in:)`

  #### Declaration

  Swift

      public func asEditable(in transaction: BaseDataTransaction) -> O?

- `asSnapshot(in:)`

  #### Declaration

  Swift

      public func asSnapshot(in dataStack: DataStack) -> ObjectSnapshot<O>?

- `asSnapshot(in:)`

  #### Declaration

  Swift

      public func asSnapshot(in transaction: BaseDataTransaction) -> ObjectSnapshot<O>?

### Equatable

- `==(_:_:)`

  #### Declaration

  Swift

      public static func == (lhs: `Self`, rhs: `Self`) -> Bool

### Hashable

- `hash(into:)`

  #### Declaration

  Swift

      public func hash(into hasher: inout Hasher)

### CustomDebugStringConvertible

- `debugDescription`

  #### Declaration

  Swift

      public var debugDescription: String { get }

### Available where `O`: `NSManagedObject`

- `subscript(dynamicMember:)`

  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 }

### Available where `O`: `CoreStoreObject`

- `subscript(dynamicMember:)`

  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 }

- `subscript(dynamicMember:)`

  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 }

- `subscript(dynamicMember:)`

  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 }

- `subscript(dynamicMember:)`

  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 }

- `subscript(dynamicMember:)`

  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 }

- `subscript(dynamicMember:)`

  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 }

- `subscript(dynamicMember:)`

  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 }

- `subscript(dynamicMember:)`

  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 }

- `subscript(dynamicMember:)`

  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 }

- `subscript(dynamicMember:)`

  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 }

- `subscript(dynamicMember:)`

  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 }