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.

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 callback with the resource for handle while marking it borrowed.
borrowAsync<T extends Object, R>(WASIComponentResourceType<T> type, int handle, Future<R> callback(T resource)) Future<R>
Runs async callback with the resource for handle while it is borrowed.
contains(int handle) bool
Returns true when handle currently refers to a live resource.
containsType<T extends Object>(WASIComponentResourceType<T> type, int handle) bool
Returns true when handle currently refers to a live type resource.
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 handle when it has type T.
insert<T extends Object>(WASIComponentResourceType<T> type, T resource) int
Inserts resource and 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.drop operation.
resourceNew<T extends Object>(WASIComponentResourceType<T> type, T representation) int
Implements the canonical ABI resource.new operation.
resourceRep<T extends Object>(WASIComponentResourceType<T> type, int handle) → T
Implements the canonical ABI resource.rep operation.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited