RustQ.Config (rustq v0.1.2)

Copy Markdown View Source

DSL for declaring generated RustQ files in rustq.exs.

A manifest is ordinary Elixir. It can require helper modules, declare generated Rust item files, or provide custom render/build functions.

use RustQ.Config

alias RustQ.Rustler

require_file "lib/my_app/codegen/schema.ex"

rust "native/my_nif/src/generated_term_helpers.rs" do
  Rustler.term_helpers()
end

rust "native/my_nif/src/generated_schema.rs" do
  MyApp.Codegen.Schema.rust_items()
end

Run mix rustq.gen to write files and mix rustq.gen --check in CI to fail when checked-in generated files are stale.

Summary

Functions

build(fun)

(macro)

content(value)

(macro)

generate(path, list)

(macro)

generate(name, path, list)

(macro)

render(template, opts \\ [])

(macro)

require_file(path)

(macro)

rust(path, list)

(macro)

rust(name, path, list)

(macro)

rust_items(path, opts)

(macro)

rust_items(name, path, opts)

(macro)

rustq(list)

(macro)