Additional `MetaMethod` docs
This commit is contained in:
parent
79b028419f
commit
0a4ae8d859
|
@ -11,6 +11,11 @@ use value::{FromLua, FromLuaMulti, ToLuaMulti};
|
||||||
use lua::Lua;
|
use lua::Lua;
|
||||||
|
|
||||||
/// Kinds of metamethods that can be overridden.
|
/// 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)]
|
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
|
||||||
pub enum MetaMethod {
|
pub enum MetaMethod {
|
||||||
/// The `+` operator.
|
/// The `+` operator.
|
||||||
|
@ -57,7 +62,9 @@ pub enum MetaMethod {
|
||||||
NewIndex,
|
NewIndex,
|
||||||
/// The call "operator" `obj(arg1, args2, ...)`.
|
/// The call "operator" `obj(arg1, args2, ...)`.
|
||||||
Call,
|
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,
|
ToString,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue