RPC
View as MarkdownThis page lists the Rust SDK names for RPCs. 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 an RPC handler | Rpc, bound to a Flow method with RpcList::function, function_without_input, procedure, or procedure_without_input in Flow::rpcs | Flow definition |
| Set the durable RPC name | The name argument of Rpc::new. It has no default. | Flow definition |
| Set the RPC timeout | timeout of Rpc | RPC timeout |
| Lock Attributes for the whole call | lock of Rpc | Locks |
| Request transactional reads and writes without locks | is_transactional of Rpc | Transactional RPCs |
| Load AttributeMap values and Channel messages | load_attribute_map, load_attribute_map_instance, load_channel, load_channel_map, and load_channel_map_instance of Rpc | Selective state loading |
| Return the output and start next Steps | RpcResult, with RpcResult::then | RPCs |
| Cancel running Steps | RpcResult::cancel_step | Cancel running Steps |
| Let a person invoke the RPC from Dex Web | Not available in the Rust SDK. | Actions |
| Invoke the RPC from a Client | Client::invoke_rpc and Client::invoke_rpc_without_input | Invoke an RPC |
| Lock or load map instances chosen at call time | RpcInvokeOptions, with Client::invoke_rpc_with_options | Runtime-selected map instances |