Crate rustler_codegen[][src]

Functions

nif_map

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:

nif_record

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:

nif_struct

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:

nif_tuple

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 map. For example, the following struct annotated as such:

nif_unit_enum

Implementation of the NifUnitEnum macro that lets the user annotate an enum with a unit type that will generate elixir atoms when encoded

nif_untagged_enum

Implementation of the NifUntaggedEnum macro that lets the user annotate an enum that will generate elixir values when decoded. This can be used for rust enums that contain data and will generate a value based on the kind of data encoded. For example from the test code: