Enum Operand
pub enum Operand {
None,
Immediate(Immediate),
Target(u64),
Token(Token),
Local(u16),
Argument(u16),
Switch(Vec<u32>),
}Expand description
Represents an operand in a more structured way.
This enum provides a high-level representation of instruction operands after decoding. It abstracts away the raw byte representation and provides typed access to different kinds of operand data.
§Examples
use dotscope::disassembler::{Operand, Immediate};
use dotscope::metadata::token::Token;
// Different operand types
let immediate = Operand::Immediate(Immediate::Int32(42));
let branch_target = Operand::Target(0x1000);
let metadata_ref = Operand::Token(Token::new(0x06000001));Variants§
None
No operand present
Immediate(Immediate)
Immediate value (constant embedded in instruction)
Target(u64)
Branch target address
Token(Token)
Metadata token reference
Local(u16)
Local variable index
Argument(u16)
Method argument index
Switch(Vec<u32>)
Switch table with multiple target addresses
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Operand
impl RefUnwindSafe for Operand
impl Send for Operand
impl Sync for Operand
impl Unpin for Operand
impl UnwindSafe for Operand
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more