Struct wasmtime_environ::component::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> 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,

§

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>,

§

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>,

§

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.