Skip to main content

MethodEnv

Struct MethodEnv 

Source
pub struct MethodEnv<'a> {
    pub pool: &'a DexPool,
    pub di: usize,
    pub dex: &'a DexFile,
    pub code: &'a CodeItem,
    pub class_name: String,
    pub method_name: Arc<str>,
    pub desc: MethodDescriptor,
    pub debug_locals: Vec<DebugLocal>,
    pub is_static: bool,
    pub code_units: u32,
}
Expand description

Everything one method body needs from its DEX image.

Fields§

§pool: &'a DexPool§di: usize

Image index of dex in the pool (keys the pool’s ref caches).

§dex: &'a DexFile§code: &'a CodeItem§class_name: String§method_name: Arc<str>§desc: MethodDescriptor§debug_locals: Vec<DebugLocal>

Debug-info local table (empty for release/stripped builds): real source names per (register, pc-range).

§is_static: bool§code_units: u32

Total code units — the CFG owns the insns stream, so the lifter reads the extent from here instead of code.insns (hollowed after the CFG build moved it).

Implementations§

Source§

impl<'a> MethodEnv<'a>

Source

pub fn type_name(&self, idx: u32) -> String

Source

pub fn java_type(&self, idx: u32) -> JavaType

Source

pub fn type_name_arc(&self, idx: u32) -> Arc<str> ⓘ

Source

pub fn field_ref(&self, idx: u32) -> (Arc<str>, Arc<str>, JavaType)

Source

pub fn method_ref( &self, idx: u32, ) -> (Arc<str>, Arc<str>, Arc<MethodDescriptor>)

Auto Trait Implementations§

§

impl<'a> Freeze for MethodEnv<'a>

§

impl<'a> RefUnwindSafe for MethodEnv<'a>

§

impl<'a> Send for MethodEnv<'a>

§

impl<'a> Sync for MethodEnv<'a>

§

impl<'a> Unpin for MethodEnv<'a>

§

impl<'a> UnsafeUnpin for MethodEnv<'a>

§

impl<'a> UnwindSafe for MethodEnv<'a>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.