xler/native/xler_native
dependabot-preview[bot] ee8a920993
Bump rustler from 0.21.0 to 0.21.1 in /native/xler_native (#5)
Bumps [rustler](https://github.com/rusterlium/rustler) from 0.21.0 to 0.21.1.
- [Release notes](https://github.com/rusterlium/rustler/releases)
- [Changelog](https://github.com/rusterlium/rustler/blob/rustler-0.21.1/CHANGELOG.md)
- [Commits](https://github.com/rusterlium/rustler/compare/rustler-0.21.0...rustler-0.21.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-18 12:41:03 +02:00
..
src Freeze rustler version on ref commit 2019-11-22 10:26:41 +00:00
Cargo.lock Bump rustler from 0.21.0 to 0.21.1 in /native/xler_native (#5) 2020-07-18 12:41:03 +02:00
Cargo.toml Bump rustler from 0.21.0 to 0.21.1 in /native/xler_native (#5) 2020-07-18 12:41:03 +02:00
README.md First commit 2019-04-11 23:39:59 +02:00

Nif for Elixir.Xler.Native

To build the NIF module:

  • Make sure your projects 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.
  • Add your crate to the rustler_crates attribute in the `project function. See here.
  • Your NIF will now build along with your project.

To load the NIF:

defmodule Xler.Native do
    use Rustler, otp_app: <otp-app>, crate: "xler_native"

    # When your NIF is loaded, it will override this function.
    def add(_a, _b), do: :erlang.nif_error(:nif_not_loaded)
end

Examples

This is a complete example of a NIF written in Rust.