wasmtime_component_resource_any_to_host function

  1. @Native<Pointer<wasmtime_error_t> Function(Pointer<wasmtime_context_t> ctx, Pointer<wasmtime_component_resource_any_t> resource, Pointer<Pointer<wasmtime_component_resource_host_t>> ret)>(ffi.Pointer<wasmtime_context_t>, ffi.Pointer<wasmtime_component_resource_any_t>, ffi.Pointer<ffi.Pointer<wasmtime_component_resource_host_t>>)>()
Pointer<wasmtime_error_t> wasmtime_component_resource_any_to_host(
  1. Pointer<wasmtime_context_t> ctx,
  2. Pointer<wasmtime_component_resource_any_t> resource,
  3. Pointer<Pointer<wasmtime_component_resource_host_t>> ret
)

\brief Attempts to convert a wasmtime_component_resource_any_t into a wasmtime_component_resource_host_t.

This function will attempt to convert the provided resource into a host-defined resource. If the resource is indeed host-defined then a new owned wasmtime_component_resource_host_t is returned via ret. If the resource is guest-defined then an error is returned and ret is not modified.

If no error is returned then the pointer written to ret must be deallocated with wasmtime_component_resource_host_delete.

Implementation

@ffi.Native<
  ffi.Pointer<wasmtime_error_t> Function(
    ffi.Pointer<wasmtime_context_t>,
    ffi.Pointer<wasmtime_component_resource_any_t>,
    ffi.Pointer<ffi.Pointer<wasmtime_component_resource_host_t>>,
  )
>()
external ffi.Pointer<wasmtime_error_t> wasmtime_component_resource_any_to_host(
  ffi.Pointer<wasmtime_context_t> ctx,
  ffi.Pointer<wasmtime_component_resource_any_t> resource,
  ffi.Pointer<ffi.Pointer<wasmtime_component_resource_host_t>> ret,
);