#backtrace #parser #zero-copy

backtrace-parser

A zero-copy parser for Rust backtraces

1 unstable release

Uses old Rust 2015

0.1.0 Jul 27, 2018
Download history 24/week @ 2022-10-27 26/week @ 2022-11-03 20/week @ 2022-11-10 18/week @ 2022-11-17 3/week @ 2022-11-24 9/week @ 2022-12-01 28/week @ 2022-12-08 6/week @ 2022-12-15 14/week @ 2022-12-22 14/week @ 2022-12-29 4/week @ 2023-01-05 10/week @ 2023-01-12 18/week @ 2023-01-19 18/week @ 2023-01-26 22/week @ 2023-02-02 7/week @ 2023-02-09

65 downloads per month

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 input = "stack backtrace: 0: 0x0 - <no info>";
let backtrace = Backtrace::parse(input).unwrap();

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

Dependencies

~3MB
~59K SLoC