Skip to content

Commit

Permalink
just enough docs to make credo happy. Definitely needs improvment
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Nelson committed Nov 30, 2024
1 parent 807ae94 commit 0579e3f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
6 changes: 6 additions & 0 deletions lib/wasmex/components.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
defmodule Wasmex.Components do
@moduledoc """
This is the entry point to support for the [WebAssembly Component Model](https://component-model.bytecodealliance.org/).
Support should be considered experimental at this point, with not all types yet supported.
"""

use GenServer
alias Wasmex.Wasi.WasiP2Options

Expand Down
4 changes: 4 additions & 0 deletions lib/wasmex/components/component.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
defmodule Wasmex.Components.Component do
@moduledoc """
This represents a compiled but not yet instantiated WebAssembly component. It is
analogous to a Module in core webassembly.
"""
@type t :: %__MODULE__{
resource: binary(),
reference: reference()
Expand Down
3 changes: 3 additions & 0 deletions lib/wasmex/components/component_instance.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
defmodule Wasmex.Components.Instance do
@moduledoc """
The component model equivalent to `Wasmex.Instance`
"""
defstruct store_resource: nil,
instance_resource: nil,
# The actual NIF store resource.
Expand Down
3 changes: 3 additions & 0 deletions lib/wasmex/components/component_store.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
defmodule Wasmex.Components.Store do
@moduledoc """
This is the component model equivalent of `Wasmex.Store`
"""
alias Wasmex.Wasi.WasiP2Options
alias Wasmex.Engine

Expand Down
4 changes: 1 addition & 3 deletions test/components/component_types_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ defmodule Wasm.Components.ComponentTypesTest do
%{"x" => 1, "y" => 2}
])

assert {:error, error} =
assert {:error, _error} =
Wasmex.Components.Instance.call_function(instance, "id-record", [
%{"invalid-field" => "foo"}
])

IO.inspect(error)
end

test "lists", %{instance: instance} do
Expand Down

0 comments on commit 0579e3f

Please sign in to comment.