pub enum MacroArg {
HexLiteral(Literal),
Ident(String),
ArgCall(ArgCall),
ArgCallMacroInvocation(String, Vec<MacroArg>),
MacroCall(MacroInvocation),
Opcode(Opcode),
BuiltinFunctionCall(BuiltinFunctionCall),
Noop,
}Expand description
An argument passed when invoking a macro
Variants§
HexLiteral(Literal)
Hexadecimal literal argument
Example: MACRO(0x04), MACRO(0x420)
Ident(String)
Macro Iden String Argument
Example: MACRO(my_label), MACRO(SOME_CONSTANT)
ArgCall(ArgCall)
An Arg Call
Passing through an argument from outer macro. Example: INNER(<value>)
ArgCallMacroInvocation(String, Vec<MacroArg>)
An Arg Call that is invoked as a macro
First-class macro invocation. Example: APPLY(<operation>())
MacroCall(MacroInvocation)
A Nested Macro Call
Example: OUTER(INNER()), TRANSFER(CALCULATE_AMOUNT())
Opcode(Opcode)
Opcode Argument
Example: APPLY_OP(add), USE_TWO_OPS(tload, clz)
BuiltinFunctionCall(BuiltinFunctionCall)
Builtin Function Call Argument
Example: MACRO(__FUNC_SIG(transfer)), MACRO(__EVENT_HASH(Transfer))
Noop
__NOOP builtin constant (generates no bytecode)
Example: MACRO(__NOOP)
Trait Implementations§
impl Eq for MacroArg
Source§impl Ord for MacroArg
impl Ord for MacroArg
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for MacroArg
impl PartialOrd for MacroArg
impl StructuralPartialEq for MacroArg
Auto Trait Implementations§
impl Freeze for MacroArg
impl RefUnwindSafe for MacroArg
impl Send for MacroArg
impl Sync for MacroArg
impl Unpin for MacroArg
impl UnsafeUnpin for MacroArg
impl UnwindSafe for MacroArg
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<S, T> Upcast<T> for S
impl<S, T> Upcast<T> for S
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 80 bytes
Size for each variant:
HexLiteral: 32 bytesIdent: 31 bytesArgCall: 79 bytesArgCallMacroInvocation: 55 bytesMacroCall: 79 bytesOpcode: 1 byteBuiltinFunctionCall: 63 bytesNoop: 0 bytes