breakpad-rs

Crates.iobreakpad-rs
lib.rsbreakpad-rs
version0.2.0
sourcesrc
created_at2024-10-22 12:40:29.825853
updated_at2024-10-22 23:39:02.954726
descriptionBreakpad for Rust
homepage
repositoryhttps://github.com/chosungmann/breakpad.rs
max_upload_size
id1418611
size29,437,610
Sungmann Cho (chosungmann)

documentation

https://docs.rs/breakpad-rs

README

breakpad.rs

https://github.com/chosungmann/breakpad.rs/actions/workflows/continuous_integration.yaml/badge.svg

breakpad.rs is a Rust crate that enables the use of Breakpad in Rust applications. When a crash occurs, it generates a minidump and notifies related information through a designated delegate.

Example

struct Delegate;

impl breakpad_rs::ExceptionHandlerDelegate for Delegate {
    fn did_write_minidump(&self, working_path: String, minidump_id: String) {
        log::debug!("[did_write_minidump] working_path={working_path} minidump_id={minidump_id}");
    }

    fn get_working_path(&self) -> String {
        log::debug!("[get_working_path] return=.");
        String::from(".")
    }

    fn should_write_minidump(&self) -> bool {
        log::debug!("[should_write_minidump] return=true");
        true
    }
}

fn main() {
    env_logger::init();
    let _breakpad = breakpad_rs::Breakpad::new(Some(Box::new(Delegate)));
    unsafe {
        let null: *mut u8 = std::ptr::null_mut();
        *null = 42;
    }
}

References

Commit count: 14

cargo fmt