Enum bddisasm::operand::OpInfo

source ·
pub enum OpInfo {
    None,
    Reg(OpReg),
    Mem(OpMem),
    Imm(u64),
    Offs(u64),
    Addr(OpAddr),
    Const(u64),
    Bank,
}
Expand description

Extended operand information, based on the actual type of the operand.

Variants§

§

None

§

Reg(OpReg)

The operand is a register.

§

Mem(OpMem)

The operand is located in memory.

§

Imm(u64)

The operand is an immediate.

§

Offs(u64)

The operand is a relative offset.

§

Addr(OpAddr)

The operand is an absolute address, in the form seg:offset.

§

Const(u64)

The operand is an implicit constant.

§

Bank

An entire bank/set of registers are being accessed. Used in PUSHA/POPA/XSAVE/LOADALL.

Implementations§

source§

impl OpInfo

source

pub fn as_reg(&self) -> Option<&OpReg>

Returns the associated OpReg for register operands. Returns None otherwise.

source

pub fn as_mem(&self) -> Option<&OpMem>

Returns the associated OpMem for memory operands. Returns None otherwise.

source

pub fn as_imm(&self) -> Option<u64>

Returns the associated immediate value for immediate operands. Returns None otherwise.

source

pub fn as_addr(&self) -> Option<&OpAddr>

Returns the associated OpAddr for absolute address operands. Returns None otherwise.

source

pub fn as_const(&self) -> Option<u64>

Returns the associated constant value for constant operands. Returns None otherwise.

source

pub fn as_bank(&self) -> Option<()>

Returns Some for bank operands. Returns None otherwise.

source

pub fn is_reg(&self) -> bool

Returns true for register operands. Returns false otherwise.

source

pub fn is_mem(&self) -> bool

Returns true for memory operands. Returns false otherwise.

source

pub fn is_imm(&self) -> bool

Returns true for immediate operands. Returns false otherwise.

source

pub fn is_addr(&self) -> bool

Returns true for absolute address operands. Returns false otherwise.

source

pub fn is_const(&self) -> bool

Returns true for constant operands. Returns false otherwise.

source

pub fn is_bank(&self) -> bool

Returns true for bank operands. Returns false otherwise.

Trait Implementations§

source§

impl Clone for OpInfo

source§

fn clone(&self) -> OpInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for OpInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for OpInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for OpInfo

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for OpInfo

source§

fn eq(&self, other: &OpInfo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for OpInfo

source§

impl Eq for OpInfo

source§

impl StructuralPartialEq for OpInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.