pub trait Instruction:
Display
+ Debug
+ Clone
+ Copy
+ PartialEq
+ EqTrait
+ Hash {
// Required method
fn opcode(&self) -> OpCode;
// Provided methods
fn is_push(&self) -> bool { ... }
fn is_dup(&self) -> bool { ... }
fn is_swap(&self) -> bool { ... }
fn is_log(&self) -> bool { ... }
fn is_terminator(&self) -> bool { ... }
}Expand description
General instruction information.
Required Methods§
Provided Methods§
Sourcefn is_push(&self) -> bool
fn is_push(&self) -> bool
Returns a value signifying whether this instruction is of the type PUSHx.
§Example
assert_eq!(Push::new([0; 10]).is_push(), true);
assert_eq!(Gas.is_push(), false);Sourcefn is_dup(&self) -> bool
fn is_dup(&self) -> bool
Returns a value signifying whether this instruction is of the type DUPx.
§Example
assert_eq!(Dup::<10>::new().is_dup(), true);
assert_eq!(Gas.is_dup(), false);Sourcefn is_swap(&self) -> bool
fn is_swap(&self) -> bool
Returns a value signifying whether this instruction is of the type SWAPx.
§Example
assert_eq!(Swap::<10>::new().is_swap(), true);
assert_eq!(Gas.is_swap(), false);Sourcefn is_log(&self) -> bool
fn is_log(&self) -> bool
Returns a value signifying whether this instruction is of the type LOGx.
§Example
assert_eq!(Log::<3>::new().is_log(), true);
assert_eq!(Gas.is_log(), false);Sourcefn is_terminator(&self) -> bool
fn is_terminator(&self) -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.