WASIComponentResourceTable class final
A typed resource table for WASI component hosts.
Component resources are represented as opaque integer handles. The table keeps the host objects typed, rejects stale handles, and prevents dropping a resource while it is borrowed by host code.
Constructors
Properties
- activeCount → int
-
Number of live resources in the table.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
borrow<
T extends Object, R> (WASIComponentResourceType< T> type, int handle, R callback(T resource)) → R -
Runs
callbackwith the resource forhandlewhile marking it borrowed. -
borrowAsync<
T extends Object, R> (WASIComponentResourceType< T> type, int handle, Future<R> callback(T resource)) → Future<R> -
Runs async
callbackwith the resource forhandlewhile it is borrowed. -
contains(
int handle) → bool -
Returns
truewhenhandlecurrently refers to a live resource. -
containsType<
T extends Object> (WASIComponentResourceType< T> type, int handle) → bool -
Returns
truewhenhandlecurrently refers to a livetyperesource. -
defineType<
T extends Object> (String name, {void onDrop(T resource)?}) → WASIComponentResourceType< T> -
Defines a nominal component resource type backed by Dart values of
T. -
drop<
T extends Object> (WASIComponentResourceType< T> type, int handle) → void -
Drops the resource for
handle. -
get<
T extends Object> (WASIComponentResourceType< T> type, int handle) → T -
Returns the resource for
handlewhen it has typeT. -
insert<
T extends Object> (WASIComponentResourceType< T> type, T resource) → int -
Inserts
resourceand returns an opaque component handle. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resourceDrop<
T extends Object> (WASIComponentResourceType< T> type, int handle) → void -
Implements the canonical ABI
resource.dropoperation. -
resourceNew<
T extends Object> (WASIComponentResourceType< T> type, T representation) → int -
Implements the canonical ABI
resource.newoperation. -
resourceRep<
T extends Object> (WASIComponentResourceType< T> type, int handle) → T -
Implements the canonical ABI
resource.repoperation. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited