Grow this table. \param cx the store that owns this table. \param delta the number of new elements to be added to this table. \param init the initial value of all new elements in this table. Returns an error if `init` has the wrong type for this table. Otherwise returns the previous size of the table before growth.
| 97 | /// Returns an error if `init` has the wrong type for this table. Otherwise |
| 98 | /// returns the previous size of the table before growth. |
| 99 | Result<uint64_t> grow(Store::Context cx, uint64_t delta, |
| 100 | const Val &init) const { |
| 101 | uint64_t prev = 0; |
| 102 | auto *error = wasmtime_table_grow(cx.ptr, &table, delta, &init.val, &prev); |
| 103 | if (error != nullptr) { |
| 104 | return Error(error); |
| 105 | } |
| 106 | return prev; |
| 107 | } |
| 108 | |
| 109 | /// Returns the raw underlying C API table this is using. |
| 110 | const wasmtime_table_t &capi() const { return table; } |