---
title: ComputeNodeGraph.StateDefinition
framework: Compute Graph
role: symbol
role_heading: Structure
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: computegraph/computenodegraph/statedefinition
---

# ComputeNodeGraph.StateDefinition

A declaration of a named state value and where it lives in the simulation.

## Declaration

```swift
struct StateDefinition
```

## Overview

Overview State definitions are used by ComputeNodeGraph/Node/Kind/loadState(definition:) and ComputeNodeGraph/Node/Kind/storeState(definition:) nodes to read and write values at a particular scope.

## Topics

### Structures

- [ComputeNodeGraph.StateDefinition.Options](computegraph/computenodegraph/statedefinition/options-swift.struct.md)

### Initializers

- [init(scope:options:type:)](computegraph/computenodegraph/statedefinition/init(scope:options:type:).md)

### Instance Properties

- [options](computegraph/computenodegraph/statedefinition/options-swift.property.md)
- [scope](computegraph/computenodegraph/statedefinition/scope.md)
- [type](computegraph/computenodegraph/statedefinition/type.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
