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
//! Collections of report attachments.
//!
//! This module provides the [`ReportAttachments`] type for managing collections
//! of attachments that can be added to reports. Attachments provide additional
//! context or debugging information beyond the main error chain.
//!
//! # Overview
//!
//! The [`ReportAttachments`] type is similar to a
//! `Vec<ReportAttachment<Dynamic, T>>` but provides a more convenient API for
//! working with collections of type-erased attachments. It includes methods
//! for:
//!
//! - Adding and removing attachments with [`push`] and [`pop`]
//! - Iterating over attachments with [`iter`]
//! - Converting between thread safety markers with [`into_local`]
//!
//! # Examples
//!
//! ```
//! use rootcause::{report_attachment::ReportAttachment, report_attachments::ReportAttachments};
//!
//! let mut attachments = ReportAttachments::new_sendsync();
//! attachments.push(ReportAttachment::new("debug info").into_dynamic());
//! attachments.push(ReportAttachment::new(42).into_dynamic());
//!
//! assert_eq!(attachments.len(), 2);
//!
//! for attachment in attachments.iter() {
//! println!("Attachment type: {:?}", attachment.inner_type_id());
//! }
//! ```
//!
//! [`push`]: ReportAttachments::push
//! [`pop`]: ReportAttachments::pop
//! [`iter`]: ReportAttachments::iter
//! [`into_local`]: ReportAttachments::into_local
pub use ;