liblisa::arch

Trait Register

pub trait Register:
    Copy
    + Sized
    + PartialOrd
    + Ord
    + PartialEq {
    // Required methods
    fn is_pc(&self) -> bool;
    fn is_zero(&self) -> bool;
    fn is_flags(&self) -> bool;
    fn mask(&self) -> Option<u64>;
    fn is_addr_reg(&self) -> bool;
    fn byte_size(&self) -> usize;
    fn reg_type(self) -> ValueType;

    // Provided method
    fn should_avoid(&self) -> bool { ... }
}
Expand description

Represents a register.

Required Methods§

fn is_pc(&self) -> bool

Returns whether this register is the program counter.

fn is_zero(&self) -> bool

Returns whether this register is the zero register.

fn is_flags(&self) -> bool

Returns whether this register is a flags register.

fn mask(&self) -> Option<u64>

Indicates which bits may be set. Any bit ‘1’ in the mask may be set, any bit ‘0’ MUST always be set to ‘0’. Returns None when the register is a crate::value::ValueType::Bytes. Returns None when all bits may be set (this is equivalent to returning Some(0xffffffff_ffffffff))

fn is_addr_reg(&self) -> bool

Returns true if the register should always contain a valid memory address.

fn byte_size(&self) -> usize

Returns the number of bytes the register uses. It must be possible to modify at least one bit in each byte.

fn reg_type(self) -> ValueType

Returns the value type of the register.

Provided Methods§

fn should_avoid(&self) -> bool

Returns true if this register should be avoided if possible. This is used by enumeration to determine which instruction would be best to analyze.

This is a hint, and can be ignored if needed.

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.

Implementors§