Expand description
mlua-pkg integration: a TealResolver that serves .tl modules through
mlua-pkg’s Registry, so Teal sources sit in the same resolution chain as
Rust-native modules, embedded Lua, vendored git deps and assets.
require("name")
Registry
├─ NativeResolver host_module userdata / Rust tables
├─ TealResolver name -> name.tl | name/init.tl (check + gen + load)
│ name -> name.d.tl (type-only: empty table)
├─ VendoredResolver mlua-pkg.toml git deps
└─ FsResolver plain .luaThe resolver must run on a Lua that an Htl was attached to
(Htl::new / Htl::from_lua); it finds the compiler through the Lua registry.
Type errors are returned as Some(Err) so, per mlua-pkg’s contract, a broken
.tl never silently falls through to a later resolver.
Re-exports§
pub use mlua_pkg;
Structs§
- Project
- An
mlua-pkg.tomlproject: where the manifest, lockfile and vendored deps live. - Teal
Resolver - Resolves
require("a.b")toa/b.tl,a/b/init.tl, ora/b.d.tlunder a sandboxed root, type-checking and generating on the fly.
Enums§
- Teal
Resolve Error - Error raised when a
.tlmodule fails the type check atrequiretime.
Constants§
Functions§
- contract_
resolvers - One
TealResolverper[[contract]]inhtl.toml, in declaration order, so the host andhtl checkenforce the same contracts from the same source.rootis the directory holdinghtl.toml(the pathHtlConfig::findreturns, minus the file name). Add them to aRegistrybefore the plain resolvers.