#backtrace #parser #zero-copy #error

backtrace-parser

A zero-copy parser for Rust backtraces

1 unstable release

Uses old Rust 2015

0.1.0 Jul 27, 2018

#75 in #backtrace

MIT license

15KB
285 lines

backtrace-parser

Build Status Crates.io Docs

A zero-copy parser for Rust backtraces.


lib.rs:

This crate implements a parser for backtraces.

The aim is to parse backtraces in the standard format that any Rust program can generate, for instance when crashing due to a panic, by creating a failure::Error, or by using the backtrace crate directly.

The parser follows a zero-copy approach, which means that the input string can be provided by reference, and will not be copied during parsing. This has the effect that parsing a captured backtrace tends to be very performant.

Example

use backtrace_parser::Backtrace;

let backtrace = Backtrace::parse(input).unwrap();

for frame in backtrace.frames() {
    for symbol in frame.symbols() {
        println!("symbol: {:?}", symbol);
    }
}

Dependencies

~3MB
~63K SLoC