ComponentInstanceState

Trait ComponentInstanceState 

Source
pub trait ComponentInstanceState: Send {
    // Required methods
    fn call_func_ret_list_u8(
        &mut self,
        instance: &str,
        func: &str,
        contents: impl FnOnce(&[u8]) + Send,
    ) -> impl Future<Output = ()> + Send;
    fn call_func_ret_s32(
        &mut self,
        instance: &str,
        func: &str,
    ) -> impl Future<Output = i32> + Send;
    fn call_func_ret_s64(
        &mut self,
        instance: &str,
        func: &str,
    ) -> impl Future<Output = i64> + Send;
    fn call_func_ret_f32(
        &mut self,
        instance: &str,
        func: &str,
    ) -> impl Future<Output = u32> + Send;
    fn call_func_ret_f64(
        &mut self,
        instance: &str,
        func: &str,
    ) -> impl Future<Output = u64> + Send;
}
Available on crate feature component-model only.
Expand description

Trait representing the ability to invoke functions on a component to learn about its internal state.

Required Methods§

Source

fn call_func_ret_list_u8( &mut self, instance: &str, func: &str, contents: impl FnOnce(&[u8]) + Send, ) -> impl Future<Output = ()> + Send

Looks up the exported instance which has func as an export, calls it, and returns the list<u8> return type.

Source

fn call_func_ret_s32( &mut self, instance: &str, func: &str, ) -> impl Future<Output = i32> + Send

Same as Self::call_func_ret_list_u8, but for the s32 WIT type.

Source

fn call_func_ret_s64( &mut self, instance: &str, func: &str, ) -> impl Future<Output = i64> + Send

Same as Self::call_func_ret_list_u8, but for the s64 WIT type.

Source

fn call_func_ret_f32( &mut self, instance: &str, func: &str, ) -> impl Future<Output = u32> + Send

Same as Self::call_func_ret_list_u8, but for the f32 WIT type.

Source

fn call_func_ret_f64( &mut self, instance: &str, func: &str, ) -> impl Future<Output = u64> + Send

Same as Self::call_func_ret_list_u8, but for the f64 WIT type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Send> ComponentInstanceState for WasmtimeWizerComponent<'_, T>

Available on crate feature wasmtime only.