wasmtime_component_resource_any_clone function

  1. @Native<Pointer<wasmtime_component_resource_any_t> Function(Pointer<wasmtime_component_resource_any_t> resource)>(ffi.Pointer<wasmtime_component_resource_any_t>)>()
Pointer<wasmtime_component_resource_any_t> wasmtime_component_resource_any_clone(
  1. Pointer<wasmtime_component_resource_any_t> resource
)

\brief Clones a component resource.

Creates a new owned copy of a component resource. Note that the returned resource still logically refers to the same resource as before, but this can be convenient from an API perspective. Calls to wasmtime_component_resource_any_drop need only happen once-per-logical-resource, not once-per-handle-to-the-resource. Note though that calls to wasmtime_component_resource_any_delete must happen once-per-handle-to-the-resource.

The pointer returned from this function must be deallocated with wasmtime_component_resource_any_delete.

Implementation

@ffi.Native<
  ffi.Pointer<wasmtime_component_resource_any_t> Function(
    ffi.Pointer<wasmtime_component_resource_any_t>,
  )
>()
external ffi.Pointer<wasmtime_component_resource_any_t>
wasmtime_component_resource_any_clone(
  ffi.Pointer<wasmtime_component_resource_any_t> resource,
);