pub struct VMComponentOffsets<P> {
pub ptr: P,
pub num_lowerings: u32,
pub num_runtime_memories: u32,
pub num_runtime_reallocs: u32,
pub num_runtime_post_returns: u32,
pub num_runtime_component_instances: u32,
pub num_trampolines: 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_reallocs: u32The number of reallocs 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_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 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 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_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_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 moresource§impl<P: Debug> Debug for VMComponentOffsets<P>
impl<P: Debug> Debug for VMComponentOffsets<P>
impl<P: Copy> Copy for VMComponentOffsets<P>
Auto Trait Implementations§
impl<P> Freeze for VMComponentOffsets<P>where
P: Freeze,
impl<P> RefUnwindSafe for VMComponentOffsets<P>where
P: RefUnwindSafe,
impl<P> Send for VMComponentOffsets<P>where
P: Send,
impl<P> Sync for VMComponentOffsets<P>where
P: Sync,
impl<P> Unpin for VMComponentOffsets<P>where
P: Unpin,
impl<P> UnwindSafe for VMComponentOffsets<P>where
P: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)