wasmtime_component_linker_instance_add_resource function
- @Native<Pointer<
wasmtime_error_t> Function(Pointer<wasmtime_component_linker_instance_t> , Pointer<wasm_byte_t> , Size, Pointer<wasmtime_component_resource_type_t> , wasmtime_component_resource_destructor_t, Pointer<Void> , Pointer<NativeFunction< )>(ffi.Pointer<wasmtime_component_linker_instance_t>, ffi.Pointer<ffi.Char>, ffi.Size, ffi.Pointer<wasmtime_component_resource_type_t>, wasmtime_component_resource_destructor_t, ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>)>()Void Function(Pointer< >Void> )>
- Pointer<
wasmtime_component_linker_instance_t> linker_instance, - Pointer<
wasm_byte_t> name, - int name_len,
- Pointer<
wasmtime_component_resource_type_t> resource, - wasmtime_component_resource_destructor_t destructor,
- Pointer<
Void> data, - Pointer<
NativeFunction< finalizer,Void Function(Pointer< >Void> )>
\brief Defines a new resource type within this instance.
This can be used to define a new resource type that the guest will be able
to import. Here the resource is a type, often a host-defined type, which
can be used to distinguish and definite different types of resources. A
destruction callback is also specified via destructor which has private
data data along with an optional finalizer for the data too.
\return on success NULL, otherwise an error
Implementation
@ffi.Native<
ffi.Pointer<wasmtime_error_t> Function(
ffi.Pointer<wasmtime_component_linker_instance_t>,
ffi.Pointer<ffi.Char>,
ffi.Size,
ffi.Pointer<wasmtime_component_resource_type_t>,
wasmtime_component_resource_destructor_t,
ffi.Pointer<ffi.Void>,
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>,
)
>()
external ffi.Pointer<wasmtime_error_t>
wasmtime_component_linker_instance_add_resource(
ffi.Pointer<wasmtime_component_linker_instance_t> linker_instance,
ffi.Pointer<ffi.Char> name,
int name_len,
ffi.Pointer<wasmtime_component_resource_type_t> resource,
wasmtime_component_resource_destructor_t destructor,
ffi.Pointer<ffi.Void> data,
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>
finalizer,
);