PackageTrack
Sign in Get early access

rustler

Safe Rust wrappers for creating Erlang NIF functions

0.38.0 9.0M downloads/mo #3297 most downloaded on crates.io rusterlium/rustler

What this package is like to depend on

Last release 3 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

5 releases in the last 12 months

see the full history below

Release timeline

58 releases · Aug 2015 to May 2026
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 58
  1. 0.38.0 25 May 2026
    Release notes

    What's Changed

    • Bump action versions and add OTP29 support by @filmor in #730
    • Add OTP-29 enif functions by @filmor in #731
    • Drop deprecated codegen features by @filmor in #701
    • Add from_iter to NewBinary by @aDifferentJT in #704
    • Implement UTF8 atom support on NIF 2.17 by @filmor in #732
    • Alternative NIF Filler adjustment for Android by @filmor in #733
    • Make ResourceArc::as_c_arg() public by @lilioid in #736
    • Relax mutability requirement of ResourceArc::as_c_arg() by @lilioid in #741
    • Add comment to Cargo.toml on where to find nif versions by @lilioid in #739
    • Add term_map macro by @dannote in #729
    • Allow deserialize_seq to deserialize binaries. by @murisi in #708
    • Ensure that the thread tests only look at their own messages by @filmor in #742

    New Contributors

    Full Changelog: rustler-0.37.4...rustler-0.38.0

    Open source →
    Release notes

    Added

    • Add Term::size on Erlang 29 = nif_version_2_18 (#731)
    • Add from_iter to NewBinary (#704)
    • Use direct UTF-8 atom support on nif_version_2_17 (#732)
    • Allow the path to the binary that carries the enif_* symbols to be passed directly to work around Android's broken RTLD_GLOBAL (#733)
    • Allow deserialize_seq to deserialize binaries (#708)

    Fixed

    Changed

    • Along with UTF-8 support, introduce new signatures for atom creation and deprecate the old ones (#732)

    Removed

    • Drop deprecated codegen features (#701)
    Open source →
  2. 0.37.4 02 May 2026
    Release notes

    What's Changed

    • fix: gate ErlNifResourceTypeInit members/dyncall on nif_version_2_16 to fix OTP 22/23 heap overflow by @lmth in #725

    New Contributors

    • @lmth made their first contribution in #725

    Full Changelog: rustler-0.37.3...rustler-0.37.4

    Open source →
    Release notes

    Fixed

    • Gate ErlNifResourceTypeInit members on nif_version_2_16 (#725)
    Open source →
  3. 0.37.3 13 Mar 2026
    Release notes

    What's Changed

    New Contributors

    Full Changelog: rustler-0.37.2...rustler-0.37.3

    Open source →
    Release notes

    Added

    • Add missing inline and From<Binary> for Term (#719)

    Fixed

    • Add no_artifacts compiler message (#721, thanks @chgeuer)
    Open source →
  4. 0.37.2 02 Dec 2025
    Release notes

    What's Changed

    Full Changelog: rustler-0.37.1...rustler-0.37.2

    Open source →
    Release notes

    Fixed

    • Fix Binary::from_iolist creating an invalid Binary (#714, #715)
    • Fix CI to use the newest Elixir and OTP versions (#713)

    Changed

    • Bump MSRV (Minimum Supported Rust Version) to 1.91 (#711)
    Open source →
  5. 0.37.0 09 Sep 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: rustler-0.36.2...rustler-0.37.0

    Open source →
    Release notes

    Added

    • Add staticlib feature to compile without nif_init and add {pkg}_nif_init symbol (#688)
    • Add IntoIterator to OwnedBinary (#702, thanks aDifferentJT)

    Fixed

    • Set ErlNifEntry.min_erts to a placeholder value (#703)

    Changed

    • Refactor build logic to remove TOML dependency (#691)
    • Use inline on commonly used functions (#475, thanks @joshuataylor)
    • Make EnifAllocator available even if the allocator feature is not enabled
    Open source →
  6. 0.36.2 09 Jun 2025
    Release notes

    What's Changed

    • Replace unsupported definition list syntax in README.md by @emig in #689
    • Implement Hash for atoms by @filmor in #695
    • 1.19 typing_violation_error by @dkuku in #696

    New Contributors

    Full Changelog: rustler-0.36.1...rustler-0.36.2

    Open source →
    Release notes

    Added

    • std::hash::Hash implementation for atoms (#695)

    Fixed

    • Fix typing error in rustler_mix (#696, thanks @dkuku)
    Open source →
  7. 0.36.1 03 Feb 2025
    Release notes

    What's Changed

    • Only depend on libloading on non-Windows systems by @filmor in #677
    • Fixes for rustler_mix by @filmor in #682

    Full Changelog: rustler-0.36.0...rustler-0.36.1

    Open source →
    Release notes

    No changes in the Rust code, only rustler_mix adjustments and dependency updates.

    Added

    • Support for Erlang-style NIF module names (:module_name) (#682)

    Fixed

    • Retrieve the newest Rustler version without additional dependencies (#682, fixes #680)
    • Adjust .gitignore handling to match the new workspace style

    Changed

    • Only depend on libloading on non-Windows systems (#677)
    Open source →
  8. 0.36.0 13 Jan 2025
    Release notes

    What's Changed

    • Fix Nif* macros requiring an encoder by @filmor in #676
    • Add workspace and remove linkage override from 'mix rustler.new' templates by @filmor in #672

    Full Changelog: rustler-0.35.1...rustler-0.36.0

    Open source →
    Release notes

    Added

    • Create a workplace Cargo.toml file with mix rustler.new (#672)

    Fixed

    • Some derive macros failed when only decode was requested (#676)

    Removed

    • The linkage override for macOS is not needed anymore and has been removed from the template (#672)
    Open source →
  9. 0.35.1 18 Dec 2024
    Release notes

    What's Changed

    Full Changelog: rustler-0.35.0...rustler-0.35.1

    Open source →
    Release notes

    Fixed

    • Fix clippy lints in rustler_codegen (#671)
    • Adjust Rustler macros to not produce warnings on Elixir 1.18 (#670)
    Open source →
  10. 0.35.0 15 Oct 2024
    Release notes

    Added

    • The resource type name can be overridden with #[register_impl(name = "...")] (#638)
    • Floats can be decoded from integers (#641, fixes #603)
    • Resource types can implement and use dynamic calls on NIF version 2.16 (#635)
    • Encoder and Decoder implementations for Box<T> (#644)
    • Reference type and env.make_ref() function (#657)

    Fixed

    • The optional register attribute on #[register_impl] works as advertised now (#638)
    • API functions for Windows are correctly assigned for NIF version 2.15 and above (#635)
    • Panics in encoding the result of NIF function are caught (#656)
    • Reverted change to "recompile if the NIF library is changed/deleted" (#654, fixes #651)

    Changed

    • The special ok/error handling for atoms in serde is now restricted to variant names (#639)
    • rustler_sys as a separate library is merged into rustler::sys and will not be released independently of rustler anymore (#653)
    Open source →
  11. 0.34.0 09 Jul 2024
    Release notes

    Added

    • Resource type registration has been refactored to eventually remove the rustler::resource! macro (#617, necessary due to a pending deprecation of a Rust feature, #606)
    • Resources can (and should) now explicitly implement the new Resource trait and provide a custom destructor function that is run before drop and receives an Env parameter (#617)
    • Process monitoring via resources can now be used on resource types that implement the Resource::down callback (#617)
    • Resource implementation and registration helper attribute (#627)

    Fixed

    • Unwinding in the on_load callback is now caught and leads to a panic (#617)

    Changed

    • NIF implementations are now discovered automatically and the respective argument of rustler::init! is ignored (#613)
    • The derive feature flag is now ignored and its functionality unconditionally enabled (#621)
    Open source →
  12. 0.33.0 29 May 2024
    Release notes

    Added

    • Optional support for using Erlang's allocator as Rust's global allocator (#580).
    • Comparison functions for PIDs (#611).
    • Conversions from and to Rust paths (PathBuf and Path) (#608).

    Fixed

    • mix compile failing on path dependencies in the Rust library (#577, fixed in #578 and #607)

    Changed

    • Drop usage of lazy_static in favour of std::sync::OnceLock. This change raises the minimal supported Rust version to 1.70.
    • Drop obsolete and incorrect Rustler.nif_versions function.

    Removed

    • The old macros rustler_export_nifs!, rustler::rustler_atoms! and resource_struct_init! have been removed (#604). They had been deprecated since version 0.22.0.
    Open source →
  13. 0.32.1 21 Mar 2024
    Release notes

    Added

    • Map iterators are now DoubleEndedIterators (#598), thus allowing being iterated in reverse using .rev()
    • Env::is_process_alive and LocalPid::is_alive (#599)
    • Encoding and decoding of 128 bit integers (#600)
    • Optional codec for num_bigint::BigInt using the big_integer feature (#601)
    • Add experimental serde support derived from serde_rustler

    Changed

    • Adjust C char types to use the proper FFI type (#592)
    • Allow arbitrary (ASCII) NIF function names (#593, idea and initial implementation by @KoviRobi)

    Removed

    • rustler_bigint is replaced by a feature flag and the wrapper is not necessary anymore (#601)
    Open source →
  14. 0.32.0 20 Mar 2024 withdrawn
    Release notes

    Yanked because it did not include all merged changes.

    Open source →
  15. 0.31.0 13 Feb 2024
    Release notes

    Added

    • Support for generic types in derive macros (#574)
    • New is_float and is_integer methods on terms (#581)

    Fixed

    • Finalized making :rustler a compile-time-only dependency (#570)
    • Make get_type work as documented for 0.30 (#581)
    • Tests on ARM64 (#584)
    • Error messages in codegen (#579)

    Changed

    • Use impl Encoder on more functions (in particular on send) (#572)
    • The generated atom modules for derived structs are now called rustler_atoms_{struct_name_in_snakecase} to silence warnings (#585)

    Removed

    • Support for initmacro in rustler-sys (v2.3.2, #589)
    Open source →
  16. 0.30.0 11 Oct 2023
    Release notes

    Added

    • Return Result<(), SendError> from all send functions (#239, #563)

    Changed

    • Deprecate :rustler_crates project configuration
    • Mark use Rustler module configuration as compile-time
    • Bump Rust edition to 2021
    • Make :rustler a compile-time-only dependency (#516, #559)
    • Use enif_term_type to implement Term::get_type (#538). Please check the UPGRADE documentation for necessary code changes.
    • Raise default NIF version to 2.15

    Removed

    • Support for RUSTLER_NIF_VERSION, NIF version requirements have to be set via features now
    Open source →
  17. 0.29.1 30 Jun 2023
    Release notes

    Fixed

    • Exclude directories from external resources for compatibility with Elixir 1.15 (#548, thanks @adrienmo)
    • Fix NifTaggedEnum derived Encoder impl for named-field variants (#547, thanks @dylanburati)
    • Remove cfg! directives in build.rs causing cross-compilation to fail (#555, thanks @fabriziosestito)
    Open source →
  18. 0.29.0 22 Jun 2023
    Release notes

    Added

    • ErlOption<T> to provide an ergonomic option type for Erlang (#507, thanks @tatsuya6502)

    Changed

    • Use Cargo features to define the NIF version level (#537), deprecating RUSTLER_NIF_VERSION
    Open source →
  19. 0.28.0 24 Apr 2023
    Release notes

    Added

    • Support OTP 26 (#526, thanks @philss)
    • Support tuples in NIF macro (#520, #527, thanks @denumerate and @philss)
    • Support for load_data_fun to compute load_data at runtime (#413, thanks @kaaboaye)

    Changed

    • Enhanced NIF macro error messages for invalid attributes (#525, thanks @philss)
    Open source →
  20. 0.27.0 17 Jan 2023
    Release notes

    Added

    • ResourceArc::make_binary for safe use of enif_make_resource_binary (#487)
    • OwnedBinary is now Sync (#493)
    • Specified MSRV to be 1.56.1.

    Changed

    • 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)
    • Edition 2021 for the rustler mix template (#512, thanks @ayrat555)

    Fixed

    • Documentation for load (#501, thanks @ishitatsuyuki)
    Open source →
  21. 0.26.0 02 Sep 2022
    Release notes

    Highlight

    TaggedEnum

    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

    • a map for the variant Named in the example above
    • a binary for the String1 and String2 variants

    The Untagged variant is represented as the atom :untagged in Elixir.

    Added

    • Added Clone and Copy for TermType (#476, thanks @dvic)
    • Added Env.whereis_pid() (#456, thanks @Qqwy)

    Changed

    • Use &[impl Encoder] for keys and values in map_from_arrays() to improve ergonomics (#453, thanks @SeokminHong)
    • Improved encode/decode performance of TaggedEnum considerably (#482, thanks @cleaton)
    • Test on OTP 25 (#455)

    Fixed

    • Lifetime handling in rustler_codegen (#483, thanks @turion @SeokminHong and @neosimsim)
    • Support multiple variants with same field names in TaggedEnum (#482, thanks @cleaton)
    • Support .toml file extension for cargo config (#468, thanks @joshuataylor for the report in #467)
    • Disambiguate encode/decode in generated code (#466, thanks @SeokminHong)
    • Migrate CI to erlef/setup-beam (#457, thanks @SeokminHong)
    • Documentation of the schedule flag for nif macro (#444)
    • Improve documentation (#429, thanks @turion)
    Open source →
  22. 0.25.0 11 Apr 2022
    Release notes

    Added

    • 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)
    • CI now also tests against macos

    Fixed

    • Snake-case warening for auto-generated RUSTLER_{}_field_{} variables (renamed to rustler_{}_field_{})

    Changed

    • Abort compilation on macos if macos target configuration is missing
    Open source →
  23. 0.24.0 24 Feb 2022
    Release notes

    Added

    • A NewBinary type to create binaries in Rust without going through OwnedBinary. This can improve performance. Thanks @dlesl!
    • TermType derives Eq and PartialEq.

    Fixed

    • Set library file extension based on the compile target, thanks @cocoa-xu!
    • Relaxed Jason version requirement to ~> 1.0
    • Various typos in the documentation, thanks @kianmeng!

    Changed

    • Rustler supports the latest 3 versions of Elixir and OTP. Currently, those are Elixir => 1.11 and OTP >= 22.
    • rustler_mix: Bumped required toml dependency to 0.6
    • Bumped rustler_sys dependency to ~2.2
    Open source →
  24. 0.23.0 23 Dec 2021
    Release notes

    Added

    • NifException for using Elixir exception structs
    • Hashing for term
    • Hash and Equality for Binary and OwnedBinary

    Fixed

    • mix rustler.new with Elixir v1.13
    • Template config for macos
    • Crash if metadata cannot be retrieved while compiling (#398)

    Changed

    • Rustler changed its supported range of OTP and Elixir versions. We aim to support the three newest versions of OTP and Elixir.
    • The decoder for Range requires that :step equals 1. The :step field was introduced with Elixir v1.12 and cannot be represented with Rust's RangeInclusive.
    • NIF API bindings are generated using Rust
    Open source →
  25. 0.22.2 07 Oct 2021
    Release notes

    Fixed

    • Fixed a regression introduced with #386: Rustler.Compiler.Config called into cargo when skip_compilation? was set, breaking setups where cargo is not installed. Fixed with #389, thanks @karolsluszniak
    Open source →
  26. 0.22.1 05 Oct 2021
    Release notes

    Fixed

    • [Breaking change] codegen-generated decoders always raise an error instead of causing the calling NIF to return an atom in some cases
    • Fix codegen problem for untagged enums (#370)
    • Fix handling local dependencies with @external_resources (#381)
    Open source →
  27. 0.22.0 23 Jun 2021
    Release notes

    Added

    • Simple Debug impl for rustler::Error
    • Support newtype and tuple structs for NifTuple and NifRecord
    • rustler::Error::Term encoding an arbitrary boxed encoder, returning {:error, term}
    • Generic encoder/decoder for HashMap<T, U>, where T: Decoder and U: Decoder

    Fixed

    • Compilation time of generated decoders has been reduced significantly.
    • Fixed a segfault caused by OwnedEnv::send_and_clear

    Changed

    • Renamed 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
      }
      

    Deprecated

    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.

    Open source →
  28. 0.22.0-rc.2 22 Jun 2021 pre-release

    Nothing published for this version

  29. 0.22.0-rc.1 21 May 2021 pre-release

    Nothing published for this version

  30. 0.22.0-rc.0 02 Mar 2020 pre-release

    Nothing published for this version

  31. 0.21.1 06 Jun 2020

    Nothing published for this version

  32. 0.21.0 07 Sep 2019
    Release notes

    Added

    • Support for OTP22.
    • Rust linting with clippy.
    • Support for decoding IOLists as binaries, Term::decode_as_binary.

    Changed

    • 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.
    • Replaced the hand-rolled TOML parser in rustler_mix with the toml-elixir package.
    • Improve error messages for derived encoders/decoders.
    • Rust 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.
    Open source →
  33. 0.20.0 26 Feb 2019

    Nothing published for this version

  34. 0.19.0 23 Jan 2019

    Nothing published for this version

  35. 0.18.0 05 Jul 2018

    Nothing published for this version

  36. 0.17.1 16 Jun 2018

    Nothing published for this version

  37. 0.17.0 14 Jun 2018

    Nothing published for this version

  38. 0.16.0 06 Feb 2018

    Nothing published for this version

  39. 0.15.1 29 Jun 2017

    Nothing published for this version

  40. 0.15.0 29 Jun 2017

    Nothing published for this version

  41. 0.14.0 08 Mar 2017

    Nothing published for this version

  42. 0.13.0 03 Feb 2017

    Nothing published for this version

  43. 0.12.0 19 Jan 2017

    Nothing published for this version

  44. 0.11.0 22 Aug 2016

    Nothing published for this version

  45. 0.10.0 24 Jul 2016

    Nothing published for this version

  46. 0.9.1 20 Jul 2016

    Nothing published for this version

  47. 0.9.0 20 Jul 2016

    Nothing published for this version

  48. 0.8.3 10 May 2016

    Nothing published for this version

  49. 0.8.2 07 May 2016

    Nothing published for this version

  50. 0.8.1 10 Apr 2016

    Nothing published for this version

  51. 0.8.0 03 Apr 2016

    Nothing published for this version

  52. 0.7.0 14 Feb 2016

    Nothing published for this version

  53. 0.6.0 24 Jan 2016

    Nothing published for this version

  54. 0.5.0 12 Jan 2016

    Nothing published for this version

  55. 0.4.0 07 Jan 2016

    Nothing published for this version

  56. 0.3.0 01 Jan 2016

    Nothing published for this version

  57. 0.2.0 30 Dec 2015

    Nothing published for this version

  58. 0.1.0 18 Aug 2015

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive