1 stable release
Uses new Rust 2024
1.0.0 | Mar 23, 2025 |
---|
#1015 in Rust patterns
127 downloads per month
10KB
249 lines
std_utils
Some common utils I add to every project
Usage
This crate contains traits tht add .anyhow()
to std::result::Result<T, String>
, std::result::Result<T, std::error::Error>
, and Option<T>
. Method returns anyhow::Result<T, anyhow::Error>
.
Trait Debugging
also implements .log()
and .logmsg("Msg here")
which uses tracing to log an error if it exists and return self
, .panic()
and .panicmsg()
do the same but panic in case of error, .context("Msg here")
and .dot()
are used for backtraces, taken from anyhow_ext.
Dependencies
~400–540KB