Module data

Module data 

Source
Expand description

ReportData<C> wrapper and field access.

This module encapsulates the fields of ReportData, ensuring they are only visible within this module. This visibility restriction guarantees the safety invariant: the vtable type must always match the actual context type.

§Safety Invariant

Since ReportData can only be constructed via ReportData::new (which creates matching vtable and context), and fields cannot be modified after construction (no pub or pub(crate) fields), the types remain in sync throughout the value’s lifetime.

§#[repr(C)] Layout

The #[repr(C)] attribute enables safe field projection even when the type parameter C is erased. This allows accessing the vtable, children, and attachments fields from a pointer to ReportData<Erased> without constructing an invalid reference to the full struct.

Structs§

ReportData 🔒
Type-erased report data structure with vtable-based dispatch.