pub struct ResourceTable {
pub imported: bool,
pub data: ResourceData,
}
Expand description
Map used for resource function bindgen within a given component
Mapping from the instance + resource index in that component (internal or external) to the unique global resource id used to key the resource tables for this resource.
The id value uniquely identifies the resource table so that if a resource is used by n components, there should be n different indices and spaces in use. The map is therefore entirely unique and fully distinct for each instance’s function bindgen.
The second bool is true if it is an imported resource.
For a given resource table id {x}, with resource index {y} the local variables are assumed:
- handleTable{x}
- captureTable{y} (rep to instance map for captured imported tables, only for JS import bindgen, not hybrid)
- captureCnt{y} for assigning capture rep
For component-defined resources:
- finalizationRegistry{x}
handleTable internally will be allocated with { rep: i32, own: bool } entries
In the case of an imported resource tables, in place of “rep” we just store the direct JS object being referenced, since in JS the object is its own handle.
Fields§
§imported: bool
§data: ResourceData
Trait Implementations§
Source§impl Clone for ResourceTable
impl Clone for ResourceTable
Source§fn clone(&self) -> ResourceTable
fn clone(&self) -> ResourceTable
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more