GetFuel returns the amount of fuel remaining in this store. If fuel consumption is not enabled via `Config.SetConsumeFuel` then this function will return an error. Otherwise this will retrieve the fuel remaining and return it. Also note that fuel, if enabled, must be originally configured via `Sto
()
| 256 | // Also note that fuel, if enabled, must be originally configured via |
| 257 | // `Store.SetFuel`. |
| 258 | func (store *Store) GetFuel() (uint64, error) { |
| 259 | var remaining uint64 |
| 260 | c_remaining := C.uint64_t(remaining) |
| 261 | err := C.wasmtime_context_get_fuel(store.Context(), &c_remaining) |
| 262 | runtime.KeepAlive(store) |
| 263 | if err != nil { |
| 264 | return 0, mkError(err) |
| 265 | } |
| 266 | |
| 267 | return uint64(c_remaining), nil |
| 268 | } |
| 269 | |
| 270 | // SetFuel sets this store's fuel to the specified value. |
| 271 | // |