mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
e9252afc92
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.14 to 0.38.19. - [Release notes](https://github.com/bytecodealliance/rustix/releases) - [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.14...v0.38.19) --- updated-dependencies: - dependency-name: rustix dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
---|---|---|
.. | ||
src | ||
Cargo.lock | ||
Cargo.toml | ||
README.md |
NIF for Elixir.Philomena.Native
To build the NIF module:
- Make sure your projects
mix.exs
has the:rustler
compiler listed in theproject
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 Philomena.Native do
use Rustler, otp_app: <otp-app>, crate: "philomena"
# 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.