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
48
49
50
51
52
53
54
55
56
57
//! Collections of reports.
//!
//! This module provides the [`ReportCollection`] type for managing collections
//! of child reports. Collections are useful for aggregating multiple related
//! errors or representing parallel error paths.
//!
//! # Overview
//!
//! The [`ReportCollection`] type is similar to a `Vec<Report<C,
//! markers::Cloneable, T>>` but provides a more convenient API tailored for
//! error handling. It includes methods for:
//!
//! - Adding and removing reports with [`push`] and [`pop`]
//! - Iterating over reports with [`iter`]
//! - Creating parent reports with [`context`] and [`context_custom`]
//! - Converting between context and thread safety markers
//!
//! # Examples
//!
//! ## Creating and populating a collection
//!
//! ```
//! use rootcause::{report, report_collection::ReportCollection};
//!
//! let mut collection = ReportCollection::new();
//! collection.push(report!("Database connection failed").into_cloneable());
//! collection.push(report!("Cache initialization failed").into_cloneable());
//!
//! assert_eq!(collection.len(), 2);
//! ```
//!
//! ## Wrapping a collection with context
//!
//! ```
//! use rootcause::{Report, report, report_collection::ReportCollection};
//!
//! let collection: ReportCollection = [report!("Service A failed"), report!("Service B failed")]
//! .into_iter()
//! .collect();
//!
//! let report: Report<&str> = collection.context("Multiple services unavailable");
//! println!("{}", report);
//! ```
//!
//! [`push`]: ReportCollection::push
//! [`pop`]: ReportCollection::pop
//! [`iter`]: ReportCollection::iter
//! [`context`]: ReportCollection::context
//! [`context_custom`]: ReportCollection::context_custom
pub use ;