Struct proguard::StackTrace[][src]

pub struct StackTrace<'s> { /* fields omitted */ }

A full Java StackTrace as printed by Throwable.printStackTrace().

Implementations

impl<'s> StackTrace<'s>[src]

pub fn new(
    exception: Option<Throwable<'s>>,
    frames: Vec<StackFrame<'s>>
) -> Self
[src]

Create a new StackTrace.

pub fn with_cause(
    exception: Option<Throwable<'s>>,
    frames: Vec<StackFrame<'s>>,
    cause: StackTrace<'s>
) -> Self
[src]

Create a new StackTrace with cause information.

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

Parses a StackTrace from a full Java StackTrace.

Examples

use proguard::{StackFrame, StackTrace, Throwable};

let stacktrace = "\
some.CustomException: Crashed!
    at some.Klass.method(Klass.java:1234)
Caused by: some.InnerException
    at some.Klass2.method2(Klass2.java:5678)
";
let parsed = StackTrace::try_parse(stacktrace.as_bytes());
assert_eq!(
    parsed,
    Some(StackTrace::with_cause(
        Some(Throwable::with_message("some.CustomException", "Crashed!")),
        vec![StackFrame::with_file(
            "some.Klass",
            "method",
            1234,
            "Klass.java",
        )],
        StackTrace::new(
            Some(Throwable::new("some.InnerException")),
            vec![StackFrame::with_file(
                "some.Klass2",
                "method2",
                5678,
                "Klass2.java",
            )]
        )
    ))
);

pub fn exception(&self) -> Option<&Throwable<'_>>[src]

The exception at the top of the StackTrace, if present.

pub fn frames(&self) -> &[StackFrame<'_>][src]

All StackFrames following the exception.

pub fn cause(&self) -> Option<&StackTrace<'_>>[src]

An optional cause describing the inner exception.

Trait Implementations

impl<'s> Clone for StackTrace<'s>[src]

impl<'s> Debug for StackTrace<'s>[src]

impl<'s> Display for StackTrace<'s>[src]

impl<'s> PartialEq<StackTrace<'s>> for StackTrace<'s>[src]

impl<'s> StructuralPartialEq for StackTrace<'s>[src]

Auto Trait Implementations

impl<'s> RefUnwindSafe for StackTrace<'s>

impl<'s> Send for StackTrace<'s>

impl<'s> Sync for StackTrace<'s>

impl<'s> Unpin for StackTrace<'s>

impl<'s> UnwindSafe for StackTrace<'s>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.