Attribute
View as MarkdownThis page lists the Rust SDK names for Attributes. The doc comment of each API gives its parameters, defaults, and errors. Read them in the Rust SDK API reference.
API names
| Task | Rust API | Dex behavior |
|---|---|---|
| Define a singleton Attribute | Attribute | Attributes |
| Define an AttributeMap | AttributeMap | Attributes |
| Declare it in the Flow | PersistenceSchema::attribute and PersistenceSchema::attribute_map, returned from Flow::persistence | Flow definition |
| Read, write, and delete a value in a Step or RPC | get, get_required, set, and delete | Commits |
| Address one AttributeMap instance | AttributeMap::instance, or the instance key argument of get, set, and delete | Attributes |
| Count AttributeMap instances and list their keys | AttributeMap::map_size and AttributeMap::all_instance_keys | Selective state loading |
| Load AttributeMap values for a method | AttributeMap::load, with the load methods of StepOptions or Rpc | 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 |
| Index a value for search | indexed, with an AttributeIndex such as AttributeIndex::keyword | Indexes |
| Project writes to an Attribute Store | sync_to_attribute_store | Attribute sync |
| Store a value that can be erased | hard_delete_on_null | Hard-delete Attributes |
| Set a value when the Flow starts | StartFlowOptions::initial_attribute and StartFlowOptions::initial_attribute_map | Attributes at start |
| Read values from outside the Flow | Client::get_attributes | 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 |