Enum mlua::MetaMethod [−][src]
pub enum MetaMethod {}Show variants
Add, Sub, Mul, Div, Mod, Pow, Unm, IDiv, BAnd, BOr, BXor, BNot, Shl, Shr, Concat, Len, Eq, Lt, Le, Index, NewIndex, Call, ToString, Pairs, Close, Custom(StdString),
Expand description
Kinds of metamethods that can be overridden.
Currently, this mechanism does not allow overriding the __gc
metamethod, since there is
generally no need to do so: UserData
implementors can instead just implement Drop
.
Variants
Expand description
The +
operator.
Expand description
The -
operator.
Expand description
The *
operator.
Expand description
The /
operator.
Expand description
The %
operator.
Expand description
The ^
operator.
Expand description
The unary minus (-
) operator.
Expand description
The floor division (//) operator.
Requires feature = "lua54/lua53"
Expand description
The bitwise AND (&) operator.
Requires feature = "lua54/lua53"
Expand description
The bitwise OR (|) operator.
Requires feature = "lua54/lua53"
Expand description
The bitwise XOR (binary ~) operator.
Requires feature = "lua54/lua53"
Expand description
The bitwise NOT (unary ~) operator.
Requires feature = "lua54/lua53"
Expand description
The bitwise left shift (<<) operator.
Expand description
The bitwise right shift (>>) operator.
Expand description
The string concatenation operator ..
.
Expand description
The length operator #
.
Expand description
The ==
operator.
Expand description
The <
operator.
Expand description
The <=
operator.
Expand description
Index access obj[key]
.
Expand description
Index write access obj[key] = value
.
Expand description
The call “operator” obj(arg1, args2, ...)
.
Expand description
The __tostring
metamethod.
This is not an operator, but will be called by methods such as tostring
and print
.
Expand description
The __pairs
metamethod.
This is not an operator, but it will be called by the built-in pairs
function.
Requires feature = "lua54/lua53/lua52"
Expand description
The __close
metamethod.
Executed when a variable, that marked as to-be-closed, goes out of scope.
More information about to-be-closed variabled can be found in the Lua 5.4 documentation.
Requires feature = "lua54"
Custom(StdString)
Expand description
A custom metamethod.
Must not be in the protected list: __gc
, __metatable
, __mlua*
.
Implementations
impl MetaMethod
[src]
impl MetaMethod
[src]Trait Implementations
impl Clone for MetaMethod
[src]
impl Clone for MetaMethod
[src]fn clone(&self) -> MetaMethod
[src]
fn clone(&self) -> MetaMethod
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for MetaMethod
[src]
impl Debug for MetaMethod
[src]impl Display for MetaMethod
[src]
impl Display for MetaMethod
[src]impl Hash for MetaMethod
[src]
impl Hash for MetaMethod
[src]impl PartialEq<MetaMethod> for MetaMethod
[src]
impl PartialEq<MetaMethod> for MetaMethod
[src]impl Eq for MetaMethod
[src]
Auto Trait Implementations
impl RefUnwindSafe for MetaMethod
impl Send for MetaMethod
impl Sync for MetaMethod
impl Unpin for MetaMethod
impl UnwindSafe for MetaMethod
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more