WebNitroErrorSlot class final
The C NitroError out-param struct read from WASM linear memory.
wasm32 layout (verified against an Emscripten build — 20 bytes):
offset 0 : int8 hasError
offset 4 : uint32 name (char*, strdup'd by the bridge)
offset 8 : uint32 message (char*)
offset 12 : uint32 code (char*, may be 0)
offset 16 : uint32 stackTrace (char*, may be 0)
The struct itself is Dart-allocated (module malloc); the string fields
are strdup'd by the C bridge and must be freed with the module's
<lib>_nitro_free.
Constructors
- WebNitroErrorSlot.alloc(NitroWasmModule module)
-
Allocates a zeroed slot in
module's heap.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- module → NitroWasmModule
-
final
- ptr → int
-
Heap offset of the struct — pass this where the C signature takes
NitroError*.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
free(
) → void - Frees the slot itself (NOT the string fields — throwIfError handles those when an error is present).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
throwIfError(
) → void -
Checks the slot after a bridge call. If an error is present: copies the
string fields into Dart, frees them with the module's
nitro_free, resets the slot for the next call, and throws a HybridException. -
throwIfErrorAndFree(
) → void -
Variant for per-call slots (
@nitroNativeAsync): checks, then frees the slot itself whether or not an error was present. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- sizeInBytes → const int