pub struct VMComponentOffsets<P> {
pub ptr: P,
pub num_lowerings: u32,
pub num_runtime_memories: u32,
pub num_runtime_tables: u32,
pub num_runtime_reallocs: u32,
pub num_runtime_callbacks: u32,
pub num_runtime_post_returns: u32,
pub num_runtime_component_instances: u32,
pub num_trampolines: u32,
pub num_unsafe_intrinsics: u32,
pub num_resources: u32,
/* private fields */
}Expand description
Runtime offsets within a VMComponentContext for a specific component.
Fields§
§ptr: PThe host pointer size
num_lowerings: u32The number of lowered functions this component will be creating.
num_runtime_memories: u32The number of memories which are recorded in this component for options.
num_runtime_tables: u32The number of tables which are recorded in this component for options.
num_runtime_reallocs: u32The number of reallocs which are recorded in this component for options.
num_runtime_callbacks: u32The number of callbacks which are recorded in this component for options.
num_runtime_post_returns: u32The number of post-returns which are recorded in this component for options.
num_runtime_component_instances: u32Number of component instances internally in the component (always at least 1).
num_trampolines: u32Number of cranelift-compiled trampolines required for this component.
num_unsafe_intrinsics: u32Number of VMFuncRefs for unsafe intrinsics within this component’s
context.
num_resources: u32Number of resources within a component which need destructors stored.
Implementations§
Source§impl<P: PtrSize> VMComponentOffsets<P>
impl<P: PtrSize> VMComponentOffsets<P>
Sourcepub fn new(ptr: P, component: &Component) -> Self
pub fn new(ptr: P, component: &Component) -> Self
Creates a new set of offsets for the component specified configured
additionally for the ptr size specified.
Sourcepub fn pointer_size(&self) -> u8
pub fn pointer_size(&self) -> u8
The size, in bytes, of the host pointer.
Sourcepub fn instance_flags(&self, index: RuntimeComponentInstanceIndex) -> u32
pub fn instance_flags(&self, index: RuntimeComponentInstanceIndex) -> u32
The offset of the flags field.
Sourcepub fn vm_store_context(&self) -> u32
pub fn vm_store_context(&self) -> u32
The offset of the vm_store_context field.
Sourcepub fn trampoline_func_refs(&self) -> u32
pub fn trampoline_func_refs(&self) -> u32
The offset of the trampoline_func_refs field.
Sourcepub fn trampoline_func_ref(&self, index: TrampolineIndex) -> u32
pub fn trampoline_func_ref(&self, index: TrampolineIndex) -> u32
The offset of VMFuncRef for the index specified.
Sourcepub fn unsafe_intrinsic_func_refs(&self) -> u32
pub fn unsafe_intrinsic_func_refs(&self) -> u32
The offset of the unsafe_intrinsic_func_refs field.
Sourcepub fn unsafe_intrinsic_func_ref(&self, intrinsic: UnsafeIntrinsic) -> u32
pub fn unsafe_intrinsic_func_ref(&self, intrinsic: UnsafeIntrinsic) -> u32
The offset of the VMFuncRef for the intrinsic specified.
Sourcepub fn lowering(&self, index: LoweredIndex) -> u32
pub fn lowering(&self, index: LoweredIndex) -> u32
The offset of the VMLowering for the index specified.
Sourcepub fn lowering_callee(&self, index: LoweredIndex) -> u32
pub fn lowering_callee(&self, index: LoweredIndex) -> u32
The offset of the callee for the index specified.
Sourcepub fn lowering_data(&self, index: LoweredIndex) -> u32
pub fn lowering_data(&self, index: LoweredIndex) -> u32
The offset of the data for the index specified.
Sourcepub fn lowering_size(&self) -> u8
pub fn lowering_size(&self) -> u8
The size of the VMLowering type
Sourcepub fn lowering_callee_offset(&self) -> u32
pub fn lowering_callee_offset(&self) -> u32
The offset of the callee field within the VMLowering type.
Sourcepub fn lowering_data_offset(&self) -> u32
pub fn lowering_data_offset(&self) -> u32
The offset of the data field within the VMLowering type.
Sourcepub fn runtime_memories(&self) -> u32
pub fn runtime_memories(&self) -> u32
The offset of the base of the runtime_memories field
Sourcepub fn runtime_memory(&self, index: RuntimeMemoryIndex) -> u32
pub fn runtime_memory(&self, index: RuntimeMemoryIndex) -> u32
The offset of the *mut VMMemoryDefinition for the runtime index
provided.
Sourcepub fn runtime_tables(&self) -> u32
pub fn runtime_tables(&self) -> u32
The offset of the base of the runtime_tables field
Sourcepub fn runtime_table(&self, index: RuntimeTableIndex) -> u32
pub fn runtime_table(&self, index: RuntimeTableIndex) -> u32
The offset of the table for the runtime index provided.
Sourcepub fn size_of_vmtable_import(&self) -> u8
pub fn size_of_vmtable_import(&self) -> u8
Return the size of VMTableImport, used here to hold the pointers to
the VMTableDefinition and VMContext.
Sourcepub fn runtime_reallocs(&self) -> u32
pub fn runtime_reallocs(&self) -> u32
The offset of the base of the runtime_reallocs field
Sourcepub fn runtime_realloc(&self, index: RuntimeReallocIndex) -> u32
pub fn runtime_realloc(&self, index: RuntimeReallocIndex) -> u32
The offset of the *mut VMFuncRef for the runtime index
provided.
Sourcepub fn runtime_callbacks(&self) -> u32
pub fn runtime_callbacks(&self) -> u32
The offset of the base of the runtime_callbacks field
Sourcepub fn runtime_callback(&self, index: RuntimeCallbackIndex) -> u32
pub fn runtime_callback(&self, index: RuntimeCallbackIndex) -> u32
The offset of the *mut VMFuncRef for the runtime index
provided.
Sourcepub fn runtime_post_returns(&self) -> u32
pub fn runtime_post_returns(&self) -> u32
The offset of the base of the runtime_post_returns field
Sourcepub fn runtime_post_return(&self, index: RuntimePostReturnIndex) -> u32
pub fn runtime_post_return(&self, index: RuntimePostReturnIndex) -> u32
The offset of the *mut VMFuncRef for the runtime index
provided.
Sourcepub fn resource_destructors(&self) -> u32
pub fn resource_destructors(&self) -> u32
The offset of the base of the resource_destructors field
Sourcepub fn resource_destructor(&self, index: ResourceIndex) -> u32
pub fn resource_destructor(&self, index: ResourceIndex) -> u32
The offset of the *mut VMFuncRef for the runtime index
provided.
Sourcepub fn size_of_vmctx(&self) -> u32
pub fn size_of_vmctx(&self) -> u32
Return the size of the VMComponentContext allocation.
Trait Implementations§
Source§impl<P: Clone> Clone for VMComponentOffsets<P>
impl<P: Clone> Clone for VMComponentOffsets<P>
Source§fn clone(&self) -> VMComponentOffsets<P>
fn clone(&self) -> VMComponentOffsets<P>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more