[−][src]Derive Macro rustler_codegen::NifTuple
#[derive(NifTuple)] { // Attributes available to this derive: #[rustler] }
Implementation of a macro that lets the user annotate a struct with NifTuple
so that the
struct can be encoded or decoded from an Elixir tuple. For example, the following struct
annotated as such:
#[derive(NifTuple)]
struct AddTuple {
lhs: i32,
rhs: i32,
}
Given the values 33 and 21 for this struct, this would result, when encoded, in an elixir tuple with two elements like:
{33, 21}
The size of the tuple will depend on the number of elements in the struct.