diff options
Diffstat (limited to 'src/userdata.rs')
-rw-r--r-- | src/userdata.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/userdata.rs b/src/userdata.rs index 98ec717..aac80df 100644 --- a/src/userdata.rs +++ b/src/userdata.rs @@ -11,6 +11,11 @@ use value::{FromLua, FromLuaMulti, ToLuaMulti}; use lua::Lua; /// Kinds of metamethods that can be overridden. +/// +/// For safety reasons, this mechanism does not allow overriding the `__gc` metamethod. [`UserData`] +/// implementors can instead just use `Drop`. +/// +/// [`UserData`]: trait.UserData.html #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum MetaMethod { /// The `+` operator. @@ -57,7 +62,9 @@ pub enum MetaMethod { NewIndex, /// The call "operator" `obj(arg1, args2, ...)`. Call, - /// tostring(ud) will call this if it exists + /// The `__tostring` metamethod. + /// + /// This is not an operator, but will be called by methods such as `tostring` and `print`. ToString, } |