Struct StackFrame

Source
pub struct StackFrame<'s> { /* private fields */ }
Expand description

A Java StackFrame.

Basically a Rust version of the Java StackTraceElement.

Implementations§

Source§

impl<'s> StackFrame<'s>

Source

pub fn new(class: &'s str, method: &'s str, line: usize) -> Self

Create a new StackFrame.

Source

pub fn with_file( class: &'s str, method: &'s str, line: usize, file: &'s str, ) -> Self

Create a new StackFrame with file information.

Source

pub fn with_parameters( class: &'s str, method: &'s str, arguments: &'s str, ) -> Self

Create a new StackFrame with arguments information and no line. This is useful for when we try to do deobfuscation with no line information.

Source

pub fn with_method_synthesized(self, is_synthesized: bool) -> Self

Flags self’s method as being synthesized by the compiler according to is_synthesized.

Source

pub fn try_parse(line: &'s [u8]) -> Option<Self>

Parses a StackFrame from a line of a Java StackTrace.

§Examples
use proguard::StackFrame;

let parsed = StackFrame::try_parse(b"    at some.Klass.method(Klass.java:1234)");
assert_eq!(
    parsed,
    Some(StackFrame::with_file(
        "some.Klass",
        "method",
        1234,
        "Klass.java"
    ))
);
Source

pub fn class(&self) -> &str

The class of the StackFrame.

Source

pub fn method(&self) -> &str

The method of the StackFrame.

Source

pub fn full_method(&self) -> String

The fully qualified method name, including the class.

Source

pub fn file(&self) -> Option<&str>

The file of the StackFrame.

Source

pub fn line(&self) -> usize

The line of the StackFrame, 1-based.

Source

pub fn parameters(&self) -> Option<&str>

The parameters of the StackFrame

Source

pub fn method_synthesized(&self) -> bool

Returns whether this frame’s method was synthesized by the compiler.

Trait Implementations§

Source§

impl<'s> Clone for StackFrame<'s>

Source§

fn clone(&self) -> StackFrame<'s>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'s> Debug for StackFrame<'s>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for StackFrame<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult

Formats the value using the given formatter. Read more
Source§

impl<'s> PartialEq for StackFrame<'s>

Source§

fn eq(&self, other: &StackFrame<'s>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'s> StructuralPartialEq for StackFrame<'s>

Auto Trait Implementations§

§

impl<'s> Freeze for StackFrame<'s>

§

impl<'s> RefUnwindSafe for StackFrame<'s>

§

impl<'s> Send for StackFrame<'s>

§

impl<'s> Sync for StackFrame<'s>

§

impl<'s> Unpin for StackFrame<'s>

§

impl<'s> UnwindSafe for StackFrame<'s>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.