# `trap-rs`
This library provides the [`trap`] function for aborting Rust programmes without the [`std`] crate.
[`trap`]: <https://docs.rs/trap/latest/trap/fn.trap.html>
[`std`]: <https://doc.rust-lang.org/nightly/std/index.html>
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.
[`std::process::abort`]: <https://doc.rust-lang.org/nightly/std/process/fn.abort.html>
## 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.
[`SIGABRT`]: <https://pubs.opengroup.org/onlinepubs/7908799/xsh/signal.h.html>
[`trap`]: <https://docs.rs/trap/latest/trap/fn.trap.html>
[`std`]: <https://doc.rust-lang.org/nightly/std/index.html>
## Copyright & licence
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.