OTP21 included the addition of enif_make_map_from_arrays which allows the creation of a map (or struct) in one go instead of repeated calls of enif_make_map_put. Rustler 0.20.0 adds the map_from_arrays function which uses enif_make_map_from_arrays if on OTP21 and otherwise falls back to repeated map puts.
OTP21 included the addition of
enif_make_map_from_arrays
which allows the creation of a map (or struct) in one go instead of repeated calls ofenif_make_map_put
. Rustler0.20.0
adds themap_from_arrays
function which usesenif_make_map_from_arrays
if on OTP21 and otherwise falls back to repeated map puts.map_from_arrays
to construct Elixir structsmap_from_arrays
to construct the nodes map