pub trait FromFFIValue: RIType {
type SelfInstance;
// Required method
fn from_ffi_value(
context: &mut dyn FunctionContext,
arg: Self::FFIType,
) -> Result<Self::SelfInstance>;
}
Expand description
Something that can be created from a ffi value.
Implementations are safe to assume that the arg
given to from_ffi_value
is only generated by the corresponding wasm::IntoFFIValue
implementation.
Required Associated Types§
Sourcetype SelfInstance
type SelfInstance
As Self
can be an unsized type, it needs to be represented by a sized type at the host.
This SelfInstance
is the sized type.
Required Methods§
Sourcefn from_ffi_value(
context: &mut dyn FunctionContext,
arg: Self::FFIType,
) -> Result<Self::SelfInstance>
fn from_ffi_value( context: &mut dyn FunctionContext, arg: Self::FFIType, ) -> Result<Self::SelfInstance>
Create SelfInstance
from the given
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.