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 mask(&self) -> Option<u64>
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
fn is_addr_reg(&self) -> bool
Returns true if the register should always contain a valid memory address.
Provided Methods§
fn should_avoid(&self) -> bool
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.