pub struct Expression {
pub type: Option<i32>,
pub symbol: Option<String>,
pub immediate: Option<u64>,
pub parent_index: Option<i32>,
pub is_relocation: Option<bool>,
}Expand description
An operand consists of 1 or more expressions, linked together as a tree.
Fields§
§type: Option<i32>IMMEDIATE_INT is by far the most common type and thus we can save some space by omitting it as the default.
symbol: Option<String>Symbol for this expression. Interpretation depends on type. Examples include: “eax”, “[”, “+”
immediate: Option<u64>If the expression can be interpreted as an integer value (IMMEDIATE_INT) the value is given here.
parent_index: Option<i32>The parent expression. Example expression tree for the second operand of: mov eax, b4 [ebx + 12] “b4” — “[” — “+” — “ebx” \ “12”
is_relocation: Option<bool>true if the expression has entry in relocation table
Implementations§
Source§impl Expression
impl Expression
Sourcepub fn type(&self) -> Type
pub fn type(&self) -> Type
Returns the enum value of type, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn symbol(&self) -> &str
pub fn symbol(&self) -> &str
Returns the value of symbol, or the default value if symbol is unset.
Sourcepub fn immediate(&self) -> u64
pub fn immediate(&self) -> u64
Returns the value of immediate, or the default value if immediate is unset.
Sourcepub fn parent_index(&self) -> i32
pub fn parent_index(&self) -> i32
Returns the value of parent_index, or the default value if parent_index is unset.
Sourcepub fn is_relocation(&self) -> bool
pub fn is_relocation(&self) -> bool
Returns the value of is_relocation, or the default value if is_relocation is unset.
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Expression
impl Debug for Expression
Source§impl Default for Expression
impl Default for Expression
Source§impl Message for Expression
impl Message for Expression
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.