Skip to main content

MethodVarAccess

Trait MethodVarAccess 

Source
pub trait MethodVarAccess<'de, 's> {
    type Error: Error;
    type ContentDeserializer: Deserializer<'de, Error = Self::Error>;

    // Required methods
    fn src(&self) -> Option<&'s str>;
    fn dst(&self) -> Option<impl Iterator<Item = &'s str>>;
    fn lv_index(&self) -> Option<usize>;
    fn lvt_row_index(&self) -> Option<usize>;
    fn op_idx(&self) -> Option<(usize, Option<usize>)>;
    fn content(self) -> Self::ContentDeserializer;
}
Expand description

Method argument name, pos, slot and comment accessor.

Required Associated Types§

Source

type Error: Error

Error type.

Source

type ContentDeserializer: Deserializer<'de, Error = Self::Error>

Type of deserializer of the element’s contents.

Required Methods§

Source

fn src(&self) -> Option<&'s str>

Source simple name.

Source

fn dst(&self) -> Option<impl Iterator<Item = &'s str>>

Destination simple names.

Source

fn lv_index(&self) -> Option<usize>

The local variable index of this variable in the current method.

Starts at the last parameter’s slot plus wideness, and increase by 1, or by 2 if it’s a double-wide primitive.

Also known as slot.

Source

fn lvt_row_index(&self) -> Option<usize>

The index of variable in the method’s local variable table.

Source

fn op_idx(&self) -> Option<(usize, Option<usize>)>

Required for cases when the lvIndex alone doesn’t uniquely identify a local variable. This is the case when variables get re-defined later on, in which case most decompilers opt to not re-define the existing var, but instead generate a new one (with both sharing the same lv_index).

(from mapping-io)

Source

fn content(self) -> Self::ContentDeserializer

Returns the content deserializer for further deserialization of this method.

It may only contain comments.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§