[][src]Derive Macro rustler::NifMap

#[derive(NifMap)]
{
    // Attributes available to this derive:
    #[rustler]
}

Implementation of a macro that lets the user annotate a struct with NifMap so that the struct can be encoded or decoded from an Elixir map. For example, the following struct annotated as such:

This example is not tested
#[derive(NifMap)]
struct AddMap {
    lhs: i32,
    rhs: i32,
}

Given the values 33 and 21 for this struct, this would result, when encoded, in an elixir map with two elements like:

%{lhs: 33, rhs: 21}