Wasmex. Components. GuestResource. Discovery
(wasmex v0.15.1)
Copy Markdown
Discovers guest-owned resources exported by a WIT world.
The returned metadata includes the component's real interface export name, including its package namespace and version. It can therefore be used directly for dynamic Wasmtime export lookup without guessing a package path.
Summary
Functions
Returns metadata for all guest resources exported by the selected WIT world.
Finds one exported guest resource by its WIT name.
Types
@type function_info() :: %{ wit_name: String.t(), elixir_name: String.t(), kind: function_kind(), arity: non_neg_integer(), has_return: boolean() }
@type function_kind() ::
:constructor | :method | :async_method | :static | :async_static
@type resource_info() :: %{ name: String.t(), interface: String.t(), interface_path: [String.t()], constructor_path: [String.t()], functions: [function_info()] }
Functions
@spec from_wit( String.t(), keyword() ) :: {:ok, [resource_info()]} | {:error, String.t()}
Returns metadata for all guest resources exported by the selected WIT world.
:path is used in parser diagnostics and defaults to "wit". Pass :world
when the WIT contains more than one world.
@spec get_resource_from_wit(String.t(), String.t() | atom(), keyword()) :: {:ok, resource_info()} | {:error, :not_found | String.t()}
Finds one exported guest resource by its WIT name.