Derive Macro rustler_codegen::NifException
source · [−]#[derive(NifException)]
{
// Attributes available to this derive:
#[module]
#[rustler]
}
Expand description
Implementation of the NifException
macro that lets the user annotate a struct that will
be translated directly from an Elixir exception to a Rust struct. For example, the following
struct, annotated as such:
ⓘ
#[derive(Debug, NifException)]
#[module = "AddException"]
pub struct AddException {
message: String,
}
This would be translated by Rustler into:
defmodule AddException do
defexception message: ""
end