#[non_exhaustive]pub enum MetaMethod {
Show 19 variants
Add,
Sub,
Mul,
Div,
Mod,
Pow,
Unm,
IDiv,
Concat,
Len,
Eq,
Lt,
Le,
Index,
NewIndex,
Call,
ToString,
Iter,
Type,
}Expand description
Kinds of metamethods that can be overridden on userdata.
Mirrors mlua::MetaMethod. The variant set is the Luau-relevant subset
(bitwise operators specific to Lua 5.3/5.4 are omitted; Luau does not use
them as metamethods).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Add
The + operator (__add).
Sub
The - operator (__sub).
Mul
The * operator (__mul).
Div
The / operator (__div).
Mod
The % operator (__mod).
Pow
The ^ operator (__pow).
Unm
The unary minus operator (__unm).
IDiv
The floor-division // operator (__idiv).
Concat
The string concatenation operator .. (__concat).
Len
The length operator # (__len).
Eq
The == operator (__eq).
Lt
The < operator (__lt).
Le
The <= operator (__le).
Index
Index access obj[key] (__index).
NewIndex
Index write access obj[key] = value (__newindex).
Call
The call operator obj(...) (__call).
ToString
The __tostring metamethod.
Iter
The __iter metamethod (Luau).
Type
The __type/__name metafield.
Implementations§
Trait Implementations§
Source§impl Clone for MetaMethod
impl Clone for MetaMethod
Source§fn clone(&self) -> MetaMethod
fn clone(&self) -> MetaMethod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MetaMethod
Source§impl Debug for MetaMethod
impl Debug for MetaMethod
Source§impl Display for MetaMethod
impl Display for MetaMethod
impl Eq for MetaMethod
Source§impl From<MetaMethod> for String
impl From<MetaMethod> for String
Source§fn from(mm: MetaMethod) -> String
fn from(mm: MetaMethod) -> String
Source§impl Hash for MetaMethod
impl Hash for MetaMethod
Source§impl PartialEq for MetaMethod
impl PartialEq for MetaMethod
Source§fn eq(&self, other: &MetaMethod) -> bool
fn eq(&self, other: &MetaMethod) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialEq<MetaMethod> for &str
impl PartialEq<MetaMethod> for &str
Source§fn eq(&self, other: &MetaMethod) -> bool
fn eq(&self, other: &MetaMethod) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialEq<MetaMethod> for String
impl PartialEq<MetaMethod> for String
Source§fn eq(&self, other: &MetaMethod) -> bool
fn eq(&self, other: &MetaMethod) -> bool
self and other values to be equal, and is used by ==.