---
title: "Attribute"
description: "This page lists the Rust SDK names for Attributes."
canonical_url: "https://docs.superdurable.io/reference/rust/attribute/"
source: "docs/reference/rust/attribute.mdx"
locale: "en"
---

# Attribute

This page lists the Rust SDK names for [Attributes](https://docs.superdurable.io/concepts/primitives/attribute.md).
The doc comment of each API gives its parameters, defaults, and errors. Read
them in the [Rust SDK API reference](https://docs.superdurable.io/reference/rust.md#api-reference).

<a id="api-names"></a>

## API names

| Task                                             | Rust API                                                                                                            | Dex behavior                                                                                                               |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Define a singleton Attribute                     | **Attribute**                                                                                                       | [Attributes](https://docs.superdurable.io/reference/server/runtime-data.md#attributes)                                     |
| Define an AttributeMap                           | **AttributeMap**                                                                                                    | [Attributes](https://docs.superdurable.io/reference/server/runtime-data.md#attributes)                                     |
| Declare it in the Flow                           | **PersistenceSchema::attribute** and **PersistenceSchema::attribute_map**, returned from **Flow::persistence**      | [Flow definition](https://docs.superdurable.io/reference/rust/flow.md#flow-definition)                                     |
| Read, write, and delete a value in a Step or RPC | **get**, **get_required**, **set**, and **delete**                                                                  | [Commits](https://docs.superdurable.io/reference/rust/step.md#commit-boundary)                                             |
| Address one AttributeMap instance                | **AttributeMap::instance**, or the instance key argument of **get**, **set**, and **delete**                        | [Attributes](https://docs.superdurable.io/reference/server/runtime-data.md#attributes)                                     |
| Count AttributeMap instances and list their keys | **AttributeMap::map_size** and **AttributeMap::all_instance_keys**                                                  | [Selective state loading](https://docs.superdurable.io/reference/rust/step-options.md#selective-state-loading)             |
| Load AttributeMap values for a method            | **AttributeMap::load**, with the load methods of **StepOptions** or **Rpc**                                         | [Selective state loading](https://docs.superdurable.io/reference/rust/step-options.md#selective-state-loading)             |
| Lock a value for a read-modify-write             | **lock**, with **wait_for_lock** or **execute_lock** of **StepOptions**, or **lock** of **Rpc**                     | [Locks](https://docs.superdurable.io/reference/server/runtime-data.md#attribute-locks)                                     |
| Index a value for search                         | **indexed**, with an **AttributeIndex** such as **AttributeIndex::keyword**                                         | [Indexes](https://docs.superdurable.io/reference/server/runtime-data.md#attribute-indexes)                                 |
| Project writes to an Attribute Store             | **sync_to_attribute_store**                                                                                         | [Attribute sync](https://docs.superdurable.io/reference/server/attribute-store-sync.md)                                    |
| Store a value that can be erased                 | **hard_delete_on_null**                                                                                             | [Hard-delete Attributes](https://docs.superdurable.io/reference/server/runtime-data.md#hard-delete-attributes)             |
| Set a value when the Flow starts                 | **StartFlowOptions::initial_attribute** and **StartFlowOptions::initial_attribute_map**                             | [Attributes at start](https://docs.superdurable.io/reference/rust/start-flow-options.md#attributes)                        |
| Read values from outside the Flow                | **Client::get_attributes**                                                                                          | [Read Attributes](https://docs.superdurable.io/reference/server/runtime-client.md#read-attributes)                         |
| Wait until a value matches                       | **Client::wait_for_attribute_match** and **Client::wait_for_attribute_map_instance_match**, with **AttributeMatch** | [Wait for an Attribute match](https://docs.superdurable.io/reference/server/runtime-client.md#wait-for-an-attribute-match) |

<a id="example"></a>

## Example

Example: [examples/rust/src/primitives/attribute/flow.rs](https://github.com/superdurable/dex/tree/main/examples/rust/src/primitives/attribute/flow.rs)
