Wasmtime
wasmtime::component::ResourceAny Class Reference

#include <val.hh>

Public Member Functions

 ResourceAny (wasmtime_component_resource_any_t *raw)
 Takes ownership of raw and wraps it with this class.
 
 ResourceAny (const ResourceAny &other)
 Copies another resource into this one.
 
ResourceAnyoperator= (const ResourceAny &other)
 Copies another resource into this one.
 
 ResourceAny (ResourceAny &&other)=default
 Moves resources from another resource into this one.
 
ResourceAnyoperator= (ResourceAny &&other)=default
 Moves resources from another resource into this one.
 
const wasmtime_component_resource_any_tcapi () const
 Returns the underlying C API pointer.
 
wasmtime_component_resource_any_tcapi ()
 Returns the underlying C API pointer.
 
wasmtime_component_resource_any_tcapi_release ()
 Gives up ownership of the underlying C pointer to the caller.
 
bool owned () const
 Returns whether this resource is owned.
 
ResourceType type () const
 Returns the type of this resource.
 
Result< std::monostate > drop (Store::Context cx) const
 Drops this resource in the component-model sense, cleaning up borrow state and executing the wasm destructor, if any.
 
Result< ResourceHostto_host (Store::Context cx) const
 Attempts to convert this resource to a host-defined resource.
 

Static Public Member Functions

static const ResourceAnyfrom_capi (wasmtime_component_resource_any_t *const *capi)
 

Detailed Description

Class representing a component model resource value which is either a guest or host-defined resource.

Member Function Documentation

◆ from_capi()

static const ResourceAny * wasmtime::component::ResourceAny::from_capi ( wasmtime_component_resource_any_t *const *  capi)
inlinestatic

Converts the raw C API representation to this class without taking ownership.


The documentation for this class was generated from the following file: