[−][src]Derive Macro rustler::NifStruct
#[derive(NifStruct)] { // Attributes available to this derive: #[module] #[rustler] }
Implementation of the NifStruct
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:
ⓘThis example is not tested
#[derive(Debug, NifStruct)] #[module = "AddStruct"] struct AddStruct { lhs: i32, rhs: i32, }
This would be translated by Rustler into:
defmodule AddStruct do
defstruct lhs: 0, rhs: 0
end