Packages

Create new rustler-based Erlang NIF libs in no time

Current section

Files

Jump to
rebar3_rustler priv rustler_lib.template
Raw

priv/rustler_lib.template

{description, "Complete Erlang NIF library written in Rust using rustler"}.
{variables, [
{name, "my_nif", "Name of the Erlang NIF lib"},
{desc, "An Erlang NIF written in Rust", "Short description of the lib"}
]}.
%% Erlang code templates
{template, "_src/my_lib.erl", "{{name}}/src/{{name}}.erl"}.
{template, "_src/my_lib.app.src", "{{name}}/src/{{name}}.app.src"}.
{template, "_rebar.config", "{{name}}/rebar.config"}.
{template, "_Makefile", "{{name}}/Makefile"}.
% Rust code templates
{template, "_native/_Cargo.toml", "{{name}}/native/{{name}}/Cargo.toml"}.
{template, "_native/lib.rs", "{{name}}/native/{{name}}/src/lib.rs"}.
{template, "_native/_README.md", "{{name}}/native/{{name}}/README.md"}.
{template, "_native/_.cargo/_config", "{{name}}/native/{{name}}/.cargo/config"}.
%% Remainder copied verbatim from rebar3 built in OTP app template
{template, "_.gitignore", "{{name}}/.gitignore"}.
{template, "_LICENSE", "{{name}}/LICENSE"}.
{template, "_README.md", "{{name}}/README.md"}.