Bare metal trapping. https://crates.io/crates/trap/
Find a file
2025-10-28 20:47:00 +01:00
src Clean up code; Update logo; 2025-10-28 20:47:00 +01:00
.gitignore Update docs; Update gitignore; Update readme; Add logo; Add docs logo; 2025-10-28 12:32:42 +01:00
Cargo.toml Clean up code; Update logo; 2025-10-28 20:47:00 +01:00
CHANGELOG.md Clean up code; Update logo; 2025-10-28 20:47:00 +01:00
DOCLOGO.svg Clean up code; Update logo; 2025-10-28 20:47:00 +01:00
LICENCE-APACHE.txt Add readme; Update docs; Add 'std' feature; Improve coverage; 2025-10-27 13:05:33 +01:00
LICENCE-MIT.txt Add readme; Update docs; Add 'std' feature; Improve coverage; 2025-10-27 13:05:33 +01:00
LOGO.svg Clean up code; Update logo; 2025-10-28 20:47:00 +01:00
README.md Update readme; Update docs; 2025-10-28 12:35:08 +01:00

trap-rs

This library provides the trap function for aborting Rust programmes without the std crate.

Fundamentally, the goal of this crate is to allow for abnormal programme termination with more or less the guarantee that execution of the current code path will stop. Usually, std::process::abort is used for this, but on platforms or in crates without std, this is not possible.

Features

The std feature can be enabled to allow for raising the SIGABRT signal when calling trap. Furthermore, the nightly feature can be enabled for more architectural support in cases where the std crate isn't available.

Copyright © 2025 Gabriel Bjørnager Jensen.

trap-rs is distributed under either an MIT licence (see LICENCE-MIT.txt) or version 2.0 of the Apache License (see LICENCE-APACHE.txt), at your option.