Struct proguard::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 farguments information and no line. This is useful for when we try to do deobfuscation with no line information.

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

Trait Implementations§

source§

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

source§

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

Returns a copy 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<'s> Display for StackFrame<'s>

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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> 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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere T: Clone,

§

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 Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

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

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

§

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 Twhere U: TryFrom<T>,

§

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.