[−][src]Attribute Macro rudeboy::metamethods
#[metamethods]
Placed on a struct or enum definition; generates an impl of
RudeboyMetamethods
to add the specified metamethods to the exported user
data.
Takes any combination of the following parameters:
- Add - allows the use of the
+
operator. Usesstd::ops::Add
- BAnd - allows the use of the
&
operator. Usesstd::ops::BitAnd
- BNot - allows the use of the unary
~
operator. Usesstd::ops::Not
- BOr - allows the use of the
|
operator. Usesstd::ops::BitOr
- BXor - allows the use of the binary
~
operator. Usesstd::ops::BitXor
- Div - allows the use of the
/
operator. Usesstd::ops::Div
- Eq - allows the use of the
==
operator. Usesstd::cmp::PartialEq
- Index - allows the use of
.
to retrieve fields. Only usable for structs with named fields - Le - allows the use of the
<=
operator. Usesstd::cmp::PartialOrd
- Lt - allows the use of the
<
operator. Usesstd::cmp::PartialOrd
- Mod - allows the use of the
%
operator. Usesstd::ops::Rem
- Mul - allows the use of the
*
operator. Usesstd::ops::Mul
- Shl - allows the use of the
<<
operator. Usesstd::ops::Shl
- Shr - allows the use of the
>>
operator. Usesstd::ops::Shr
- Sub - allows the use of the binary
-
operator. Usesstd::ops::Sub
- Unm - allows the use of the unary
-
operator. Usesstd::ops::Neg
Note: all binary operators currently take a parameter of the same type as the type the metamethod is being added to. This is not obviously not ideal.