# `Wasmex.Components.Instance`

The component model equivalent to `Wasmex.Instance`.

Most applications should use `Wasmex.Components` or
`Wasmex.Components.ComponentServer` instead.

# `t`

```elixir
@type t() :: %Wasmex.Components.Instance{
  instance_resource: binary(),
  reference: reference(),
  store_resource: binary()
}
```

# `call_function`

```elixir
@spec call_function(
  t(),
  Wasmex.Components.function_name_or_path(),
  list(),
  GenServer.from(),
  non_neg_integer() | nil
) :: :ok
```

Schedules a call to an exported component function.

The `from` argument must be the caller tuple passed to
`c:GenServer.handle_call/3`. The result is sent to that caller after execution.
`timeout` is the remaining time in milliseconds, or `nil` for no deadline.
When it expires, the reply is discarded. If the guest call is in progress,
Wasmex requests a Wasmtime epoch interruption and later calls through this
API return `{:error, :instance_interrupted}`. An in-progress host call may
continue holding the store until it returns.

# `new`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
