wasmtime_environ::component

Struct VMComponentOffsets

Source
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: P

The host pointer size

§num_lowerings: u32

The number of lowered functions this component will be creating.

§num_runtime_memories: u32

The number of memories which are recorded in this component for options.

§num_runtime_reallocs: u32

The number of reallocs which are recorded in this component for options.

§num_runtime_post_returns: u32

The number of post-returns which are recorded in this component for options.

§num_runtime_component_instances: u32

Number of component instances internally in the component (always at least 1).

§num_trampolines: u32

Number of cranelift-compiled trampolines required for this component.

§num_resources: u32

Number of resources within a component which need destructors stored.

Implementations§

Source§

impl<P: PtrSize> VMComponentOffsets<P>

Source

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.

Source

pub fn pointer_size(&self) -> u8

The size, in bytes, of the host pointer.

Source

pub fn magic(&self) -> u32

The offset of the magic field.

Source

pub fn libcalls(&self) -> u32

The offset of the libcalls field.

Source

pub fn instance_flags(&self, index: RuntimeComponentInstanceIndex) -> u32

The offset of the flags field.

Source

pub fn store(&self) -> u32

The offset of the store field.

Source

pub fn limits(&self) -> u32

The offset of the limits field.

Source

pub fn trampoline_func_refs(&self) -> u32

The offset of the trampoline_func_refs field.

Source

pub fn trampoline_func_ref(&self, index: TrampolineIndex) -> u32

The offset of VMFuncRef for the index specified.

Source

pub fn lowerings(&self) -> u32

The offset of the lowerings field.

Source

pub fn lowering(&self, index: LoweredIndex) -> u32

The offset of the VMLowering for the index specified.

Source

pub fn lowering_callee(&self, index: LoweredIndex) -> u32

The offset of the callee for the index specified.

Source

pub fn lowering_data(&self, index: LoweredIndex) -> u32

The offset of the data for the index specified.

Source

pub fn lowering_size(&self) -> u8

The size of the VMLowering type

Source

pub fn lowering_callee_offset(&self) -> u32

The offset of the callee field within the VMLowering type.

Source

pub fn lowering_data_offset(&self) -> u32

The offset of the data field within the VMLowering type.

Source

pub fn runtime_memories(&self) -> u32

The offset of the base of the runtime_memories field

Source

pub fn runtime_memory(&self, index: RuntimeMemoryIndex) -> u32

The offset of the *mut VMMemoryDefinition for the runtime index provided.

Source

pub fn runtime_reallocs(&self) -> u32

The offset of the base of the runtime_reallocs field

Source

pub fn runtime_realloc(&self, index: RuntimeReallocIndex) -> u32

The offset of the *mut VMFuncRef for the runtime index provided.

Source

pub fn runtime_post_returns(&self) -> u32

The offset of the base of the runtime_post_returns field

Source

pub fn runtime_post_return(&self, index: RuntimePostReturnIndex) -> u32

The offset of the *mut VMFuncRef for the runtime index provided.

Source

pub fn resource_destructors(&self) -> u32

The offset of the base of the resource_destructors field

Source

pub fn resource_destructor(&self, index: ResourceIndex) -> u32

The offset of the *mut VMFuncRef for the runtime index provided.

Source

pub fn size_of_vmctx(&self) -> u32

Return the size of the VMComponentContext allocation.

Trait Implementations§

Source§

impl<P: Clone> Clone for VMComponentOffsets<P>

Source§

fn clone(&self) -> VMComponentOffsets<P>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Debug> Debug for VMComponentOffsets<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.