1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Commonly used items for convenient importing.
//!
//! The prelude module re-exports the most frequently used types, traits, and
//! macros from the rootcause library. This allows you to import everything you
//! need with a single use statement.
//!
//! # Usage
//!
//! ```
//! use rootcause::prelude::*;
//!
//! fn divide(a: i32, b: i32) -> Result<i32, Report> {
//! if b == 0 {
//! bail!("cannot divide by zero");
//! }
//! Ok(a / b)
//! }
//!
//! fn main() {
//! let result: Result<i32, Report> = divide(10, 2);
//! assert_eq!(result.unwrap(), 5);
//! }
//! ```
//!
//! # What's Included
//!
//! This prelude includes:
//!
//! - **[`Report`]**: The main error reporting type
//! - **[`ResultExt`]**: Extension methods for `Result` types
//! - **[`IteratorExt`]**: Extension methods for iterators
//! - **[`report!`]** and **[`bail!`]**: Macros for creating and returning
//! errors
//! - **[`handlers`]**: Built-in error handlers for common scenarios
//! - **[`markers`]**: Type markers for controlling report behavior
//! - **[`report_attachment!`]**: Macro for attaching contextual data
//!
//! # When to Use the Prelude
//!
//! Use the prelude when you need standard error handling functionality without
//! writing multiple import statements. For more specialized needs, import
//! specific items directly from their respective modules.
pub use crate::;