All Versions
19
Latest Version
Avg Release Cycle
95 days
Latest Release
1082 days ago
Changelog History
Page 1
Changelog History
Page 1
-
v0.25.0 Changes
April 11, 2022โ Added
NewBinary
now also available asrustler::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 torustler_{}_field_{}
)
๐ Changed
- ๐ Abort compilation on macos if macos target configuration is missing
-
v0.24.0 Changes
February 24, 2022โ Added
- A
NewBinary
type to create binaries in Rust without going throughOwnedBinary
. This can improve performance. Thanks @dlesl! TermType
derivesEq
andPartialEq
.
โก๏ธ Updated
rustler_mix
: Bumped required toml dependency to 0.6- โฌ๏ธ Bumped
rustler_sys
dependency to~2.2
.
๐ Changed
- โ Rustler supports the latest 3 versions of Elixir and OTP. Currently, those are Elixir => 1.11 and OTP >= 22.
๐ 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!
- A
-
v0.23.0 Changes
December 22, 2021โ Added
- ๐ป
NifException
for using Elixir exception structs - Hashing for term
- Hash and Equality for
Binary
andOwnedBinary
๐ 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
equals1
. The:step
field was introduced with Elixir v1.12 and cannot be represented with Rust'sRangeInclusive
. - NIF API bindings are generated using Rust
- ๐ป
-
v0.22.2 Changes
October 07, 2021๐ Fixed
- ๐ Fixed a regression introduced with #386:
Rustler.Compiler.Config
called intocargo
whenskip_compilation?
was set, breaking setups where cargo is not installed. Fixed with #389, thanks @karolsluszniak
- ๐ Fixed a regression introduced with #386:
-
v0.22.1 Changes
October 05, 2021๐ 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)
-
v0.22.0 Changes
September 07, 2019โ Added
- Simple
Debug
impl forrustler::Error
- ๐ Support newtype and tuple structs for
NifTuple
andNifRecord
rustler::Error::Term
encoding an arbitrary boxed encoder, returning{:error, term}
- Generic encoder/decoder for
HashMap<T, U>
, whereT: Decoder
andU: Decoder
๐ Fixed
- Compilation time of generated decoders has been reduced significantly.
- Fixed a segfault caused by
OwnedEnv::send_and_clear
๐ Changes
- ๐ Renamed
Pid
toLocalPid
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 nowrustler::init!
rustler_atoms!
is nowrustler::atoms!
resource_struct_init!
is nowrustler::resource!
- ๐ New
rustler::atoms!
macro removed theatom
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 implementsEncoder
:
// // 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 }
๐ Deprecations
๐ The rustler compiler has been deprecated and will be removed with v1.0. NIFs ๐ are no longer defined in
mix.exs
, but are configured withuse Rustler
. See ๐ the documentation for theRustler
module. To migrate to the new ๐ง configuration:- โฌ๏ธ Drop
:rustler
from the:compilers
key in yourmix.exs
project/0
function - โฌ๏ธ Drop
:rustler_crates
fromproject/0
and move the configurations into theuse Rustler
of your NIF module or application config:
# config/dev.exs config :my_app, MyApp.Native, mode: :debug
๐ For more information, see the documentation.
- Simple
-
v0.22.0-rc.0
March 02, 2020 -
v0.21.2
June 18, 2020 -
v0.21.1
June 06, 2020 -
v0.21.0 Changes
September 07, 2019โ Added
- ๐ Support for OTP22.
- ๐ Rust linting with clippy.
- Support for decoding IOLists as binaries,
Term::decode_as_binary
.
๐ Changes
rustler_codegen
is now reexported by therustler
crate. Depending on therustler_codegen
crate is deprecated.erlang_nif-sys
has been renamed torustler_sys
and vendored into the rustler repo.- ๐ฆ Replaced the hand-rolled TOML parser in
rustler_mix
with thetoml-elixir
package. - ๐ Improve error messages for derived encoders/decoders.
- Rust
bool
now corresponds only to booleans (false
,true
) in Elixir. Previously,nil
andfalse
were both decodable tobool
. To use the previous behaviour, aTruthy
newtype was introduced.