Trait VMComponentAsyncStore
pub trait VMComponentAsyncStore {
// Required methods
unsafe fn prepare_call(
&mut self,
instance: Instance,
memory: *mut VMMemoryDefinition,
start: NonNull<VMFuncRef>,
return_: NonNull<VMFuncRef>,
caller_instance: RuntimeComponentInstanceIndex,
callee_instance: RuntimeComponentInstanceIndex,
task_return_type: TypeTupleIndex,
callee_async: bool,
string_encoding: StringEncoding,
result_count: u32,
storage: *mut ValRaw,
storage_len: usize,
) -> Result<(), Error>;
unsafe fn start_call(
&mut self,
instance: Instance,
callback: *mut VMFuncRef,
post_return: *mut VMFuncRef,
callee: NonNull<VMFuncRef>,
param_count: u32,
result_count: u32,
flags: u32,
storage: *mut MaybeUninit<ValRaw>,
storage_len: usize,
) -> Result<(), Error>;
fn future_write(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
ty: TypeFutureTableIndex,
options: OptionsIndex,
future: u32,
address: u32,
) -> Result<u32, Error>;
fn future_read(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
ty: TypeFutureTableIndex,
options: OptionsIndex,
future: u32,
address: u32,
) -> Result<u32, Error>;
fn future_drop_writable(
&mut self,
instance: Instance,
ty: TypeFutureTableIndex,
writer: u32,
) -> Result<(), Error>;
fn stream_write(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
ty: TypeStreamTableIndex,
options: OptionsIndex,
stream: u32,
address: u32,
count: u32,
) -> Result<u32, Error>;
fn stream_read(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
ty: TypeStreamTableIndex,
options: OptionsIndex,
stream: u32,
address: u32,
count: u32,
) -> Result<u32, Error>;
fn flat_stream_write(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
ty: TypeStreamTableIndex,
options: OptionsIndex,
payload_size: u32,
payload_align: u32,
stream: u32,
address: u32,
count: u32,
) -> Result<u32, Error>;
fn flat_stream_read(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
ty: TypeStreamTableIndex,
options: OptionsIndex,
payload_size: u32,
payload_align: u32,
stream: u32,
address: u32,
count: u32,
) -> Result<u32, Error>;
fn stream_drop_writable(
&mut self,
instance: Instance,
ty: TypeStreamTableIndex,
writer: u32,
) -> Result<(), Error>;
fn error_context_debug_message(
&mut self,
instance: Instance,
ty: TypeComponentLocalErrorContextTableIndex,
options: OptionsIndex,
err_ctx_handle: u32,
debug_msg_address: u32,
) -> Result<(), Error>;
fn thread_new_indirect(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
func_ty_idx: ModuleInternedTypeIndex,
start_func_table_idx: RuntimeTableIndex,
start_func_idx: u32,
context: i32,
) -> Result<u32, Error>;
}Expand description
Trait representing component model ABI async intrinsics and fused adapter helper functions.
SAFETY (callers): Most of the methods in this trait accept raw pointers,
which must be valid for at least the duration of the call (and possibly for
as long as the relevant guest task exists, in the case of *mut VMFuncRef
pointers used for async calls).
Required Methods§
unsafe fn prepare_call(
&mut self,
instance: Instance,
memory: *mut VMMemoryDefinition,
start: NonNull<VMFuncRef>,
return_: NonNull<VMFuncRef>,
caller_instance: RuntimeComponentInstanceIndex,
callee_instance: RuntimeComponentInstanceIndex,
task_return_type: TypeTupleIndex,
callee_async: bool,
string_encoding: StringEncoding,
result_count: u32,
storage: *mut ValRaw,
storage_len: usize,
) -> Result<(), Error>
unsafe fn prepare_call( &mut self, instance: Instance, memory: *mut VMMemoryDefinition, start: NonNull<VMFuncRef>, return_: NonNull<VMFuncRef>, caller_instance: RuntimeComponentInstanceIndex, callee_instance: RuntimeComponentInstanceIndex, task_return_type: TypeTupleIndex, callee_async: bool, string_encoding: StringEncoding, result_count: u32, storage: *mut ValRaw, storage_len: usize, ) -> Result<(), Error>
A helper function for fused adapter modules involving calls where the one of the caller or callee is async.
This helper is not used when the caller and callee both use the sync ABI, only when at least one is async is this used.
unsafe fn start_call(
&mut self,
instance: Instance,
callback: *mut VMFuncRef,
post_return: *mut VMFuncRef,
callee: NonNull<VMFuncRef>,
param_count: u32,
result_count: u32,
flags: u32,
storage: *mut MaybeUninit<ValRaw>,
storage_len: usize,
) -> Result<(), Error>
unsafe fn start_call( &mut self, instance: Instance, callback: *mut VMFuncRef, post_return: *mut VMFuncRef, callee: NonNull<VMFuncRef>, param_count: u32, result_count: u32, flags: u32, storage: *mut MaybeUninit<ValRaw>, storage_len: usize, ) -> Result<(), Error>
A helper function for fused adapter modules to start a call previously
set up with prepare_call.
fn future_write(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
ty: TypeFutureTableIndex,
options: OptionsIndex,
future: u32,
address: u32,
) -> Result<u32, Error>
fn future_write( &mut self, instance: Instance, caller: RuntimeComponentInstanceIndex, ty: TypeFutureTableIndex, options: OptionsIndex, future: u32, address: u32, ) -> Result<u32, Error>
The future.write intrinsic.
fn future_read(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
ty: TypeFutureTableIndex,
options: OptionsIndex,
future: u32,
address: u32,
) -> Result<u32, Error>
fn future_read( &mut self, instance: Instance, caller: RuntimeComponentInstanceIndex, ty: TypeFutureTableIndex, options: OptionsIndex, future: u32, address: u32, ) -> Result<u32, Error>
The future.read intrinsic.
fn future_drop_writable(
&mut self,
instance: Instance,
ty: TypeFutureTableIndex,
writer: u32,
) -> Result<(), Error>
fn future_drop_writable( &mut self, instance: Instance, ty: TypeFutureTableIndex, writer: u32, ) -> Result<(), Error>
The future.drop-writable intrinsic.
fn stream_write(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
ty: TypeStreamTableIndex,
options: OptionsIndex,
stream: u32,
address: u32,
count: u32,
) -> Result<u32, Error>
fn stream_write( &mut self, instance: Instance, caller: RuntimeComponentInstanceIndex, ty: TypeStreamTableIndex, options: OptionsIndex, stream: u32, address: u32, count: u32, ) -> Result<u32, Error>
The stream.write intrinsic.
fn stream_read(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
ty: TypeStreamTableIndex,
options: OptionsIndex,
stream: u32,
address: u32,
count: u32,
) -> Result<u32, Error>
fn stream_read( &mut self, instance: Instance, caller: RuntimeComponentInstanceIndex, ty: TypeStreamTableIndex, options: OptionsIndex, stream: u32, address: u32, count: u32, ) -> Result<u32, Error>
The stream.read intrinsic.
fn flat_stream_write(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
ty: TypeStreamTableIndex,
options: OptionsIndex,
payload_size: u32,
payload_align: u32,
stream: u32,
address: u32,
count: u32,
) -> Result<u32, Error>
fn flat_stream_write( &mut self, instance: Instance, caller: RuntimeComponentInstanceIndex, ty: TypeStreamTableIndex, options: OptionsIndex, payload_size: u32, payload_align: u32, stream: u32, address: u32, count: u32, ) -> Result<u32, Error>
The “fast-path” implementation of the stream.write intrinsic for
“flat” (i.e. memcpy-able) payloads.
fn flat_stream_read(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
ty: TypeStreamTableIndex,
options: OptionsIndex,
payload_size: u32,
payload_align: u32,
stream: u32,
address: u32,
count: u32,
) -> Result<u32, Error>
fn flat_stream_read( &mut self, instance: Instance, caller: RuntimeComponentInstanceIndex, ty: TypeStreamTableIndex, options: OptionsIndex, payload_size: u32, payload_align: u32, stream: u32, address: u32, count: u32, ) -> Result<u32, Error>
The “fast-path” implementation of the stream.read intrinsic for “flat”
(i.e. memcpy-able) payloads.
fn stream_drop_writable(
&mut self,
instance: Instance,
ty: TypeStreamTableIndex,
writer: u32,
) -> Result<(), Error>
fn stream_drop_writable( &mut self, instance: Instance, ty: TypeStreamTableIndex, writer: u32, ) -> Result<(), Error>
The stream.drop-writable intrinsic.
fn error_context_debug_message(
&mut self,
instance: Instance,
ty: TypeComponentLocalErrorContextTableIndex,
options: OptionsIndex,
err_ctx_handle: u32,
debug_msg_address: u32,
) -> Result<(), Error>
fn error_context_debug_message( &mut self, instance: Instance, ty: TypeComponentLocalErrorContextTableIndex, options: OptionsIndex, err_ctx_handle: u32, debug_msg_address: u32, ) -> Result<(), Error>
The error-context.debug-message intrinsic.
fn thread_new_indirect(
&mut self,
instance: Instance,
caller: RuntimeComponentInstanceIndex,
func_ty_idx: ModuleInternedTypeIndex,
start_func_table_idx: RuntimeTableIndex,
start_func_idx: u32,
context: i32,
) -> Result<u32, Error>
fn thread_new_indirect( &mut self, instance: Instance, caller: RuntimeComponentInstanceIndex, func_ty_idx: ModuleInternedTypeIndex, start_func_table_idx: RuntimeTableIndex, start_func_idx: u32, context: i32, ) -> Result<u32, Error>
The thread.new-indirect intrinsic
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".