Crates.io | bugsalot |
lib.rs | bugsalot |
version | 0.2.2 |
source | src |
created_at | 2019-06-21 23:47:29.137174 |
updated_at | 2022-01-26 02:49:00.406286 |
description | Debugging macros and APIs for shipping stable codebases. |
homepage | |
repository | https://github.com/MaulingMonkey/bugsalot |
max_upload_size | |
id | 142715 |
size | 60,267 |
This crate provides macros and methods for bug wrangling. Specifically, I want all the advantages of crashing (bug
reports, ease of debugging, etc.) with none of the drawbacks (lost progress, pissed off gamers, etc). Rust's error
handling mechanisms (Try
, ?
, Result
s, etc.) are great, but leave something to be desired when it comes to actual
bugs. Similarly, Rust's panic!
, .unwrap()
, .expect()
, etc. are decent when it comes to giving context for bugs,
but less great for writing stable software. This crate will attempt to bridge the gap.
Branch | Badges | Notes |
---|---|---|
publish | Stable/published version | |
master | "Completed" stuff that hasn't been published. | |
wip/* | "Work In Progress" - incomplete, use at your own risk. | |
dead/* | Abandoned threads of work |
Platform | Breakpoints | Debugger | CI | Stable | Beta | Nightly |
---|---|---|---|---|---|---|
Windows | ||||||
Android | ||||||
Linux | ||||||
(Release) | ||||||
FreeBSD | ||||||
NetBSD | ||||||
OS X | ||||||
iOS | ||||||
WASM |
Add one of the following bugsalot dependencies to your Cargo.toml:
[dependencies]
bugsalot = "0.2" # Or...
bugsalot = { version = "0.2", features = ["wasm-bindgen"] } # If using: wasm-pack
bugsalot = { version = "0.2", features = ["stdweb"] } # If using: cargo web build
Write your code (see examples and documentation for more code):
use bugsalot::*;
fn main() {
let _ = debugger::wait_until_attached(None); // Wait for a debugger to be attached
loop {
let a : Option<i32> = Some(42);
let b : Result<i32, &'static str> = Err("Unavailable");
let a = expect!(a, "Unable to do something or other", return);
let b = expect!(b, "Unable to do something or other", break);
// Debugger will pause on the above line, continuing will break out of the loop
}
expect!(true, "Booleans work too");
}
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.