From 7971781f94f354f5878bfc9f814dc3a6999dee13 Mon Sep 17 00:00:00 2001 From: Kile Asmussen Date: Sun, 29 Mar 2026 14:11:25 +0200 Subject: [PATCH] Small changes --- .gitignore | 1 + src/lib.rs | 6 ++++++ src/prelude.rs | 2 ++ src/result_ext.rs | 9 +++++++++ 4 files changed, 18 insertions(+) diff --git a/.gitignore b/.gitignore index 6abfe1b..bf14f74 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target /.direnv +/.claude \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index a5c831a..c0f515e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -82,8 +82,14 @@ //! - **[`rootcause-backtrace`]** - Automatic stack trace capture for debugging. //! Install hooks to attach backtraces to all errors, or use the extension //! trait to add them selectively. +//! - **[`rootcause-tracing`]** - Integration with the [`tracing`] crate, annotating +//! reports with what span they were created in. +//! - More to come, including OpenTelemetry integration, and +//! a crate of fun extra bits and pieces. //! //! [`rootcause-backtrace`]: https://docs.rs/rootcause-backtrace +//! [`tracing`]: https://docs.rs/tracing +//! [`rootcause-tracing`]: https://docs.rs/rootcause-tracing //! //! ## Project Goals //! diff --git a/src/prelude.rs b/src/prelude.rs index aaaed33..b25c5c3 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -34,6 +34,8 @@ //! - **[`handlers`]**: Built-in error handlers for common scenarios //! - **[`markers`]**: Type markers for controlling report behavior //! - **[`report_attachment!`]**: Macro for attaching contextual data +//! - **[`IntoRootcause`]**: Conversion trait for converting other kinds of +//! errors into [`Report`]s //! //! # When to Use the Prelude //! diff --git a/src/result_ext.rs b/src/result_ext.rs index b69f570..f10c33d 100644 --- a/src/result_ext.rs +++ b/src/result_ext.rs @@ -23,6 +23,15 @@ use crate::{ /// - **Adding attachments**: [`attach`](ResultExt::attach), /// [`attach_with`](ResultExt::attach_with), and variants add supplementary /// data to the error +/// - **Conversions:** +/// - [`context_to`](ResultExt::context_to) allows transformation of +/// contexts using the [`ReportConversion`] trait. +/// - [`context_transform`](ResultExt::context_transform) uses a closure +/// to transform contexts. +/// - [`context_transform_nested`](ResultExt::context_transform_nested) +/// removes the context, leaving a [`PreformattedContext`] in its place +/// and then transforms the removed context before creating a new report +/// with that context, wrapping the old one. /// /// Each method has a `local_*` variant for working with types that are not /// `Send + Sync`.