wasmtime_context_get_fuel function

  1. @Native<Pointer<wasmtime_error_t> Function(Pointer<wasmtime_context_t> context, Pointer<Uint64> fuel)>(ffi.Pointer<wasmtime_context_t>, ffi.Pointer<ffi.Uint64>)>()
Pointer<wasmtime_error_t> wasmtime_context_get_fuel(
  1. Pointer<wasmtime_context_t> context,
  2. Pointer<Uint64> fuel
)

\brief Returns the amount of fuel remaining in this context's store.

If fuel consumption is not enabled via #wasmtime_config_consume_fuel_set then this function will return an error. Otherwise NULL is returned and the fuel parameter is filled in with fuel consumed so far.

Also note that fuel, if enabled, must be originally configured via #wasmtime_context_set_fuel.

Implementation

@ffi.Native<
  ffi.Pointer<wasmtime_error_t> Function(
    ffi.Pointer<wasmtime_context_t>,
    ffi.Pointer<ffi.Uint64>,
  )
>()
external ffi.Pointer<wasmtime_error_t> wasmtime_context_get_fuel(
  ffi.Pointer<wasmtime_context_t> context,
  ffi.Pointer<ffi.Uint64> fuel,
);