Expand description
htl: Teal, hidden.
Embeds the Teal compiler (tl.lua) into an mlua state so .tl sources can be
type-checked, generated and executed without any external toolchain.
Htl::check/ [Htl::gen]: type-check and generate Lua from a.tlfileHtl::install_searcher: strictrequirefor.tl(type errors abort the require)Htl::preload: register generated Lua (e.g. frominclude_tl!) under a module namebundle: stripped-bytecode bundles produced byhtl build
Re-exports§
pub use mlua;
Modules§
- bundle
- Stripped-bytecode bundle format (
.hb). - pkg
- mlua-pkg integration: a
TealResolverthat serves.tlmodules through mlua-pkg’sRegistry, so Teal sources sit in the same resolution chain as Rust-native modules, embedded Lua, vendored git deps and assets. - teal
- Rust <-> Teal type bridge used by
#[derive(TealRecord)]and#[host_module]. - testing
htl test: discovery, one isolated Lua state per test file, compile, report.
Structs§
Constants§
- SKIP_
DIRS - Directories never descended into when collecting sources under a root: build output, installed packages, VCS and tool state. A root passed explicitly is always walked.
- TEAL_
VERSION - Teal version vendored into this crate.
Functions§
- collect_
tl - Collect
.tlsources from files and directories (sorted, recursive). Directories inSKIP_DIRS, dot-directories and the project’s package dir are not entered unless given as a root themselves. - is_
skipped_ dir truefor a directory entry that source collection should not enter: a name inSKIP_DIRS, any dot-directory, or the project’s mlua-pkg directory (pkgs_dir, whichMLUA_PKG_DIRcan move somewhere unremarkable).- is_
tl_ source trueforfoo.tlbut notfoo.d.tl.- module_
name root/foo/bar.tl->foo.bar,root/foo/init.tl->foo.- parent_
dir - Parent directory of a file,
.when the path has none. - project_
skip_ dirs - Extra directories to skip below
root: the mlua-pkg package dir whenrootis inside anmlua-pkg.tomlproject (its vendored / cached sources are dependencies, not the project’s own files). - strip_
traceback - Remove a trailing Lua
stack traceback:section from an error text. - user_
message - A user-facing message for an error that came out of running Lua: the innermost
cause without Lua’s
stack traceback:block. A host function’sErr(e)surfaces ase’s own text; a Luaerror("msg")surfaces asfile:line: msg. - write_
if_ changed - Write
texttopathonly if the content differs. Returnstruewhen written. Used by the derive macros to emit.d.tlfiles without churning cargo’s fingerprints.