alef 0.30.13

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  defmodule {{ behaviour_module }} do
    @moduledoc """
    Typed host interface for the `{{ trait_name }}` plugin bridge.

    A plugin handler module implements this behaviour and is registered with
    `{{ register_fn }}/2`. Each callback receives the decoded arguments for a
    trait method and returns the method's result. The dispatching GenServer
    passes the decoded `args` map to the callback for the corresponding method.
    """
{% for cb in callbacks %}

    @doc "Handle the `{{ cb.method }}` trait call."
    @callback {{ cb.name }}({{ cb.params_spec }}) :: {{ cb.return_spec }}
{% endfor %}
  end