diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/userdata.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/userdata.rs b/src/userdata.rs index 0641457..0ad5f46 100644 --- a/src/userdata.rs +++ b/src/userdata.rs @@ -118,7 +118,17 @@ pub enum MetaMethod { /// /// [`ipairs`]: https://www.lua.org/manual/5.2/manual.html#pdf-ipairs #[cfg(any(feature = "lua52", feature = "luajit52", doc))] + #[cfg_attr(docsrs, doc(cfg(any(feature = "lua52", feature = "luajit52"))))] IPairs, + /// The `__iter` metamethod. + /// + /// Executed before the iteration begins, and should return an iterator function like `next` + /// (or a custom one). + /// + /// Requires `feature = "lua"` + #[cfg(any(feature = "luau", doc))] + #[cfg_attr(docsrs, doc(cfg(feature = "luau")))] + Iter, /// The `__close` metamethod. /// /// Executed when a variable, that marked as to-be-closed, goes out of scope. @@ -203,6 +213,8 @@ impl MetaMethod { MetaMethod::Pairs => "__pairs", #[cfg(any(feature = "lua52", feature = "luajit52"))] MetaMethod::IPairs => "__ipairs", + #[cfg(feature = "luau")] + MetaMethod::Iter => "__iter", #[cfg(feature = "lua54")] MetaMethod::Close => "__close", @@ -270,6 +282,8 @@ impl From<StdString> for MetaMethod { "__pairs" => MetaMethod::Pairs, #[cfg(any(feature = "lua52", feature = "luajit52"))] "__ipairs" => MetaMethod::IPairs, + #[cfg(feature = "luau")] + "__iter" => MetaMethod::Iter, #[cfg(feature = "lua54")] "__close" => MetaMethod::Close, |