mix.exs
has the :rustler
compiler listed in the project
function: compilers: [:rustler] ++ Mix.compilers()
If there already is a :compilers
list, you should append :rustler
to it.rustler_crates
attribute in the `project function. See here.```elixir
defmodule Bridge.LMDB do
use Rustler, otpapp:
# When your NIF is loaded, it will override this function.
def add(_a, _b), do: :erlang.nif_error(:nif_not_loaded)
end ```
This is a complete example of a NIF written in Rust.