Generates Rustler NIF wrappers, stubs, NifStruct declarations, and raw NIF_TERM builders.
Most helpers in this module use RustQ AST. The raw NIF_TERM builders are an
explicit low-level Rustler escape boundary for unsafe wrapper APIs; prefer
RustQ.Rustler.Term helpers when normal Term<'a> values are available.
Summary
Functions
Returns selected, export-named Rust function metadata from one source file.
Returns selected, export-named Rust function metadata from multiple source groups.
Builds the rustler::init! declaration for an Elixir module.
Builds unsafe raw NIF_TERM map and struct helpers.
Builds a Rust struct deriving NifStruct for an Elixir struct module.
Builds an Elixir stub module from mixed RustQ.Syn.Function and RustQ AST metadata.
Builds an Elixir NIF-not-loaded stub module from one Rust source file.
Builds one Elixir NIF-not-loaded stub module from multiple Rust source groups.
Builds one NIF wrapper that delegates to an implementation function.
Builds NIF wrappers from explicit export specifications.
Builds NIF wrappers whose signatures are derived from Rust functions in one source file.
Builds NIF wrappers from multiple {source_path, specs} groups.
Types
Functions
@spec functions_from_source(Path.t(), [spec()], keyword()) :: [ {atom() | String.t(), RustQ.Syn.Function.t()} ]
Returns selected, export-named Rust function metadata from one source file.
@spec functions_from_sources( [{Path.t(), [spec()]}], keyword() ) :: [{atom() | String.t(), RustQ.Syn.Function.t()}]
Returns selected, export-named Rust function metadata from multiple source groups.
@spec init(module() | String.t()) :: RustQ.Rust.AST.MacroItemCall.t()
Builds the rustler::init! declaration for an Elixir module.
@spec raw_term_builders(keyword()) :: [RustQ.Rust.Fragment.t()]
Builds unsafe raw NIF_TERM map and struct helpers.
Builds a Rust struct deriving NifStruct for an Elixir struct module.
@spec stubs_from_functions( [RustQ.Syn.Function.t() | RustQ.Rust.AST.Function.t() | {term(), term()}], module() ) :: String.t()
Builds an Elixir stub module from mixed RustQ.Syn.Function and RustQ AST metadata.
Builds an Elixir NIF-not-loaded stub module from one Rust source file.
Builds one Elixir NIF-not-loaded stub module from multiple Rust source groups.
@spec wrapper( atom() | String.t(), keyword() ) :: RustQ.Rust.AST.Function.t()
Builds one NIF wrapper that delegates to an implementation function.
@spec wrappers([spec()]) :: [RustQ.Rust.AST.Function.t()]
Builds NIF wrappers from explicit export specifications.
@spec wrappers_from_source(Path.t(), [spec()], keyword()) :: [ RustQ.Rust.AST.Function.t() ]
Builds NIF wrappers whose signatures are derived from Rust functions in one source file.
@spec wrappers_from_sources( [{Path.t(), [spec()]}], keyword() ) :: [RustQ.Rust.AST.Function.t()]
Builds NIF wrappers from multiple {source_path, specs} groups.