Writing Rust NIFs for your Elixir code with the Rustler package

defp deps do
[
{:rustler, "~> 0.16.0"}
]
end
iex(1)> Rustnif.NifTest.return_string()
"Hello world!"
iex(2)> Rustnif.NifTest.return_list()
[1, 2, 3, 4]
error[E0599]: no method named `encode` found for type `std::collections::HashMap<std::string::String, {integer}>` in the current scope
--> src/lib.rs:46:12
|
46 | Ok(map.encode(env))
| ^^^^^^
pub enum SchedulerFlags {
Normal = 0,
DirtyCpu = 1,
DirtyIo = 2,
}

--

--

--

Functional programming with Elixir, Erlang, and Rust.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

GraphQL Anti-pattern in FrontEnd Clients

Git : Under the hood

Running Oracle 18.4.0 XE in Docker container on Yandex.Cloud

Best Practices for DeFi Project in Cronos

Gearing up the Web for 2018

Run a Hackathon or Classroom Labs in Azure

Salesforce Metadata Migration using workbench

Why DevOps Culture drives success

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jacob Lerche

Jacob Lerche

Functional programming with Elixir, Erlang, and Rust.

More from Medium

Elixir tap and then macros — life-saving helpers

In Phoenix, how does the router, controller, template, and view code work together to render…

Elixir — A Tincture for Functional Programming Part 1.4 Pattern Matching

Build an Apollo Federated API in Rust — From the view of a JS Dev