RustQ.Generated (rustq v0.2.0)

Copy Markdown View Source

File sync helpers for RustQ-generated sources.

Most projects should use rustq.exs with mix rustq.gen. Use this module directly when a project already has its own Mix task and only needs RustQ's write/check behavior.

RustQ.Generated.sync!(:helpers,
  path: "native/my_nif/src/generated_helpers.rs",
  build: fn -> render_helpers() end
)

Pass check: true to compare without writing, which is useful in CI.

Summary

Types

target()

@type target() :: {atom() | String.t(), keyword()}

Functions

check!(path, expected, opts \\ [])

@spec check!(Path.t(), iodata(), keyword()) :: :ok

load_manifest!(path \\ "rustq.exs")

@spec load_manifest!(Path.t()) :: [target()]

sync!(name, target, opts \\ [])

@spec sync!(atom() | String.t(), keyword(), keyword()) :: :ok

sync_all!(targets, opts \\ [])

@spec sync_all!(
  [target()],
  keyword()
) :: :ok

write!(path, contents)

@spec write!(Path.t(), iodata()) :: :ok