NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #3336 most downloaded on crates.io
Safe Rust wrappers for creating Erlang NIF functions
Last release 4 months ago
25 May 2026
Ships fairly regularly
a new release about every 2 months
Some releases are documented
notes for 27 of 54 stable releases
1 version withdrawn
withdrawn after publishing
11 years old
58 releases · first in 2015
Drop deprecated codegen features by @filmor in #701
ResourceArc::as_c_arg() public by @lilioid in #736Full Changelog: rustler-0.37.4...rustler-0.38.0
One column per quarter.
Term::size on Erlang 29 = nif_version_2_18 (#731)from_iter to NewBinary (#704)nif_version_2_17 (#732)enif_* symbols to be passed
directly to work around Android's broken RTLD_GLOBAL (#733)deserialize_seq to deserialize binaries (#708)fix: gate ErlNifResourceTypeInit members/dyncall on nif_version_2_16 to fix OTP 22/23 heap overflow by @lmth in #725
Full Changelog: rustler-0.37.3...rustler-0.37.4
Add missing inline and From for Term by @filmor in #719
From<Binary> for Term (#719)Bump MSRV to 1.91 by @filmor in #711
Full Changelog: rustler-0.37.1...rustler-0.37.2
Binary::from_iolist creating an invalid Binary (#714, #715)Build refactor by @filmor in #691
Full Changelog: rustler-0.36.2...rustler-0.37.0
staticlib feature to compile without nif_init and add {pkg}_nif_init
symbol (#688)IntoIterator to OwnedBinary (#702, thanks aDifferentJT)ErlNifEntry.min_erts to a placeholder value (#703)inline on commonly used functions (#475, thanks @joshuataylor)EnifAllocator available even if the allocator feature is not enabledReplace unsupported definition list syntax in README.md by @emig in #689
std::hash::Hash implementation for atoms (#695)rustler_mix (#696, thanks @dkuku)Only depend on libloading on non-Windows systems by @filmor in #677
Full Changelog: rustler-0.36.0...rustler-0.36.1
No changes in the Rust code, only rustler_mix adjustments and dependency
updates.
:module_name) (#682).gitignore handling to match the new workspace stylelibloading on non-Windows systems (#677)Fix Nif* macros requiring an encoder by @filmor in #676
Nif* macros requiring an encoder by @filmor in #676Full Changelog: rustler-0.35.1...rustler-0.36.0
Cargo.toml file with mix rustler.new (#672)decode was requested (#676)Fix clippy lints by @filmor in #671
Full Changelog: rustler-0.35.0...rustler-0.35.1
rustler_codegen (#671)Rustler macros to not produce warnings on Elixir 1.18 (#670)The resource type name can be overridden with #[register_impl(name = "...")]
#[register_impl(name = "...")] (#638)Encoder and Decoder implementations for Box<T> (#644)Reference type and env.make_ref() function (#657)register attribute on #[register_impl] works as advertised
now (#638)rustler_sys as a separate library is merged into rustler::sys and will not
be released independently of rustler anymore (#653)…macro (#617, necessary due to a pending deprecation of a Rust feature, #606)
rustler::resource! macro (#617, necessary due to a pending deprecation of a
Rust feature, #606)Resource trait
and provide a custom destructor function that is run before drop and
receives an Env parameter (#617)Resource::down callback (#617)on_load callback is now caught and leads to a panic (#617)rustler::init! is ignored (#613)derive feature flag is now ignored and its functionality unconditionally
enabled (#621)…have been removed (#604). They had been deprecated since version 0.22.0.
PathBuf and Path) (#608).mix compile failing on path dependencies in the Rust library (#577, fixed in
#578 and #607)lazy_static in favour of std::sync::OnceLock. This change
raises the minimal supported Rust version to 1.70.Rustler.nif_versions function.rustler_export_nifs!, rustler::rustler_atoms! and
resource_struct_init! have been removed (#604). They had been deprecated
since version 0.22.0.Map iterators are now DoubleEndedIterators (#598), thus allowing being iterated in reverse using .rev()
.rev()Env::is_process_alive and LocalPid::is_alive (#599)num_bigint::BigInt using the big_integer feature (#601)serde support derived from serde_rustlerrustler_bigint is replaced by a feature flag and the wrapper is not
necessary anymore (#601)Yanked because it did not include all merged changes.
Yanked because it did not include all merged changes.
Support for generic types in derive macros
is_float and is_integer methods on terms (#581):rustler a compile-time-only dependency (#570)get_type work as documented for 0.30 (#581)impl Encoder on more functions (in particular on send) (#572)rustler_atoms_{struct_name_in_snakecase} to silence warnings (#585)initmacro in rustler-sys (v2.3.2, #589)Deprecate :rustler_crates project configuration
Result<(), SendError> from all send functions (#239, #563):rustler_crates project configurationuse Rustler module configuration as compile-time:rustler a compile-time-only dependency (#516, #559)enif_term_type to implement Term::get_type (#538). Please check the
UPGRADE documentation for necessary code changes.RUSTLER_NIF_VERSION, NIF version requirements have to be set via
features nowExclude directories from external resources for compatibility with Elixir 1.15 (#548, thanks @adrienmo)
NifTaggedEnum derived Encoder impl for named-field variants (#547,
thanks @dylanburati)cfg! directives in build.rs causing cross-compilation to fail (#555,
thanks @fabriziosestito)Use Cargo features to define the NIF version level (#537), deprecating RUSTLER_NIF_VERSION
ErlOption<T> to provide an ergonomic option type for Erlang (#507, thanks @tatsuya6502)RUSTLER_NIF_VERSIONSupport OTP 26 (#526, thanks @philss)
load_data_fun to compute load_data at runtime (#413, thanks
@kaaboaye)ResourceArc::make_binary for safe use of enif_make_resource_binary
ResourceArc::make_binary for safe use of enif_make_resource_binary (#487)OwnedBinary is now Sync (#493)MIX_ENV is no longer considered for determining the build profile. Now, the
profile defaults to :release. Use the :mode option to pick another
profile explicitly. (#496)load (#501, thanks @ishitatsuyuki)We added TaggedEnum, which is a generalized enum type (#440, thanks to @SeokminHong!). Example:
We added TaggedEnum, which is a generalized enum type (#440, thanks to
@SeokminHong!). Example:
#[derive(NifTaggedEnum)]
pub enum TaggedEnum1 {
Named { x: i32, y: i32 },
String1(String),
String2(String),
Untagged,
}
On the Elixir side, the variants are represented as two-tuples {tag::atom(), inner::term()} | atom(), where the inner term is
Named in the example aboveString1 and String2 variantsThe Untagged variant is represented as the atom :untagged in Elixir.
Clone and Copy for TermType (#476, thanks @dvic)Env.whereis_pid() (#456, thanks @Qqwy)&[impl Encoder] for keys and values in map_from_arrays() to improve
ergonomics (#453, thanks @SeokminHong)rustler_codegen (#483, thanks @turion @SeokminHong and
@neosimsim)encode/decode in generated code (#466, thanks @SeokminHong)erlef/setup-beam (#457, thanks @SeokminHong)schedule flag for nif macro (#444)NewBinary now also available as rustler::NewBinary (thanks @ayrat555)
NewBinary now also available as rustler::NewBinary (thanks @ayrat555)Term::map_from_pairs() to conveniently build a map from a list of pairs
(thanks @philss)RUSTLER_{}_field_{} variables
(renamed to rustler_{}_field_{})A NewBinary type to create binaries in Rust without going through OwnedBinary. This can improve performance. Thanks @dlesl!
NewBinary type to create binaries in Rust without going through
OwnedBinary. This can improve performance. Thanks @dlesl!TermType derives Eq and PartialEq.rustler_mix: Bumped required toml dependency to 0.6rustler_sys dependency to ~2.2NifException for using Elixir exception structs
NifException for using Elixir exception structsBinary and OwnedBinarymix rustler.new with Elixir v1.13macosRange requires that :step equals 1. The :step field
was introduced with Elixir v1.12 and cannot be represented with Rust's
RangeInclusive.Fixed a regression introduced with #386: Rustler.Compiler.Config called into cargo when skip_compilation? was set, breaking setups where cargo is not
Rustler.Compiler.Config called into
cargo when skip_compilation? was set, breaking setups where cargo is not
installed. Fixed with #389, thanks @karolsluszniak[Breaking change] codegen-generated decoders always raise an error instead of causing the calling NIF to return an atom in some cases
@external_resources (#381)Macros have been renamed and old ones have been deprecated:
Debug impl for rustler::ErrorNifTuple and NifRecordrustler::Error::Term encoding an arbitrary boxed encoder, returning
{:error, term}HashMap<T, U>, where T: Decoder and U: DecoderOwnedEnv::send_and_clearRenamed Pid to LocalPid to clarify that it can't point to a remote process
Dependencies have been updated.
Derive macros have been refactored.
Macros have been renamed and old ones have been deprecated:
rustler_export_nifs! is now rustler::init!rustler_atoms! is now rustler::atoms!resource_struct_init! is now rustler::resource!New rustler::atoms! macro removed the atom prefix from the name:
//
// Before
//
rustler::rustler_atoms! {
atom ok;
atom error;
atom renamed_atom = "Renamed";
}
//
// After
//
rustler::atoms! {
ok,
error,
renamed_atom = "Renamed",
}
NIF functions can be initialized with a simplified syntax:
//
// Before
//
rustler::rustler_export_nifs! {
"Elixir.Math",
[
("add", 2, add)
],
None
}
//
// After
//
rustler::init!("Elixir.Math", [add]);
NIFs can be derived from regular functions, if the arguments implement
Decoder and the return type implements Encoder:
//
// Before
//
fn add<'a>(env: Env<'a>, args: &[Term<'a>]) -> Result<Term<'a>, Error> {
let num1: i64 = args[0].decode()?;
let num2: i64 = args[1].decode()?;
Ok((atoms::ok(), num1 + num2).encode(env))
}
//
// After
//
#[rustler::nif]
fn add(a: i64, b: i64) -> i64 {
a + b
}
rustler::nif exposes more options to configure a NIF were the NIF is
defined:
#[rustler::nif(schedule = "DirtyCpu")]
pub fn dirty_cpu() -> Atom {
let duration = Duration::from_millis(100);
std::thread::sleep(duration);
atoms::ok()
}
#[rustler::nif(name = "my_add")]
fn add(a: i64, b: i64) -> i64 {
a + b
}
The rustler compiler has been deprecated and will be removed with v1.0. NIFs
are no longer defined in mix.exs, but are configured with use Rustler. See
the documentation for the Rustler module. To migrate to the new
configuration:
Drop :rustler from the :compilers key in your mix.exs project/0
function
Drop :rustler_crates from project/0 and move the configurations into the
use Rustler of your NIF module or application config:
# config/dev.exs
config :my_app, MyApp.Native,
mode: :debug
For more information, see the documentation.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
rustler_codegen is now reexported by the rustler crate. Depending on the rustler_codegen crate is deprecated.
Term::decode_as_binary.rustler_codegen is now reexported by the rustler crate. Depending on the
rustler_codegen crate is deprecated.erlang_nif-sys has been renamed to rustler_sys and vendored into the
rustler repo.rustler_mix with the toml-elixir package.bool now corresponds only to booleans (false, true) in Elixir.
Previously, nil and false were both decodable to bool. To use the
previous behaviour, a Truthy newtype was introduced.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →