Function rustler_codegen::nif_record[][src]

pub fn nif_record(input: TokenStream) -> TokenStream

Implementation of the NifRecord macro that lets the user annotate a struct that will be translated directly from an Elixir struct to a Rust struct. For example, the following struct, annotated as such:

#[derive(Debug, NifRecord)]
#[tag = "record"]
struct AddRecord {
   lhs: i32,
   rhs: i32,
}

This would be translated by Rustler into:

defmodule AddRecord do
    import Record
    defrecord :record, [lhs: 1, rhs: 2]
end