SplitScript reference / Index
Index
capability
capability Index
Reads a value selected by bracket indexing.
The implementing type chooses one key type and one returned value type. Arrays use u32 keys, while maps use their declared key type. Source structs can participate by defining an exact Index.at method.
Examples
Read an indexed value
let names = ["Ada", "Grace"]
let first = names[0]
Methods
| Member | Description | Available through |
|---|---|---|
| at | Reads the value selected by a key. |