Struct stacktrace::StackInfo [] [src]

pub struct StackInfo(pub Vec<FrameInfo>);

A stack trace. Contains a vector of function call frames, in call stack order.

Example use

use stacktrace::StackInfo;

fn layer1() -> StackInfo { StackInfo::new() }

fn layer2() -> StackInfo { layer1() }

fn layer3() -> StackInfo { layer2() }

// If debugging symbols are enabled, we should see something like the following:
//
// stack backtrace:
//    0 - 0xdeadbeef00000000 - backtrace::trace (/home/user/cargo/backtrace/something.rs:42)
//    1 - 0xdeadbeef0000abcd - stacktrace::StackInfo::new (/home/user/cargo/stacktrace/somet
// hing_else.rs:99)
//    2 - 0xdeadbeefcafebead - simple::layer1 (src/your_test_file.rs:30)
//    3 - 0xdeadbeefcafef00d - simple::layer2 (src/your_test_file.rs:32)
//    4 - 0xdeadbeeff00dcafe - simple::layer3 (src/your_test_file.rs:34)
//    5 - 0xdeadbeefbead1234 - simple::main (src/your_test_file.rs:51)
println!("{:?}", layer3());

Methods

impl StackInfo
[src]

fn new() -> Self

Construct a stack trace.

There is a tradeoff between offering a macro for constructing a new trace, and providing a function. Using a macro removes a few unnecessary calls from the resulting stack, but usually results in unusable debugging symbols. We choose to only offer the function.

Trait Implementations

impl Eq for StackInfo
[src]

impl PartialEq for StackInfo
[src]

fn eq(&self, __arg_0: &StackInfo) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &StackInfo) -> bool

This method tests for !=.

impl Clone for StackInfo
[src]

fn clone(&self) -> StackInfo

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Debug for StackInfo
[src]

fn fmt(&self, fmt: &mut Formatter) -> Result

Formats the value using the given formatter.