fuel property

int? get fuel

The remaining fuel, or null when fuel consumption is not configured.

Implementation

int? get fuel {
  if (isDisposed) return null;
  return scoped((arena) {
    final out = arena<ffi.Uint64>();
    final error = c.wasmtime_context_get_fuel(context, out);
    if (error != ffi.nullptr) {
      c.wasmtime_error_delete(error);
      return null;
    }
    return out.value;
  });
}
set fuel (int value)

Sets the fuel that WebAssembly may consume.

Requires WasmConfig.consumeFuel.

Implementation

set fuel(int value) =>
    throwIfError(c.wasmtime_context_set_fuel(context, value));