Skip to content

Commit 1b75701

Browse files
committed
Update docs for createMetaTable
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
1 parent 0cac043 commit 1b75701

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lua.zig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,6 +1577,16 @@ pub const Lua = struct {
15771577

15781578
/// Creates a metatable for a struct type without registering it globally.
15791579
///
1580+
/// Iterates over all public and meta functions in the struct to create bindings.
1581+
/// Functions with comptime parameters are not supported and will throw compile time errors.
1582+
///
1583+
/// The `init` function will be renamed to `new` and treated as a userdata constructor.
1584+
/// If the struct has a `deinit` function, it will be registered with Luau's newUserdataDtor
1585+
/// (see `createUserDataInstance` for implementation specifics).
1586+
///
1587+
/// Instance methods are supported, but the first parameter must be a userdata pointer.
1588+
/// Metamethods (functions starting with `__`) are also supported.
1589+
///
15801590
/// Provides flexibility to modify the metatable before use. For simple registration
15811591
/// with global access, use `registerUserData` instead.
15821592
///

0 commit comments

Comments
 (0)