rootcause_internals/report/
mod.rs

1//! Type-erased report data structures.
2//!
3//! This module implements type erasure for error reports through vtable-based
4//! dispatch. The design allows reports with any context type `C` to be stored
5//! uniformly while maintaining the ability to format and inspect them.
6//!
7//! # Structure
8//!
9//! - [`data`]: Contains [`ReportData<C>`], the `#[repr(C)]` wrapper that pairs
10//!   a context value with its vtable, children, and attachments
11//! - [`raw`]: Contains [`RawReport`], [`RawReportRef`], and [`RawReportMut`] -
12//!   the type-erased pointer types that users of this module interact with
13//! - [`vtable`]: Contains [`ReportVtable`], the function pointer table for
14//!   type-erased operations
15//!
16//! # Allocation Strategy
17//!
18//! Reports use `Arc<ReportData<C>>` for storage, enabling cheap cloning and
19//! shared ownership. The `Arc` is converted to a raw pointer for type erasure,
20//! then reconstructed when dropping or accessing with the concrete type.
21//!
22//! [`ReportData<C>`]: data::ReportData
23//! [`ReportVtable`]: vtable::ReportVtable
24
25pub(crate) mod data;
26pub(crate) mod raw;
27pub(crate) mod vtable;
28
29pub use raw::{RawReport, RawReportMut, RawReportRef};