Expand description
Vtable for type-erased report operations.
This module contains the ReportVtable which enables calling handler
methods on reports when their concrete context type C and handler type H
have been erased. The vtable stores function pointers that dispatch to the
correct typed implementations.
This module encapsulates the fields of ReportVtable so they cannot be
accessed directly. This visibility restriction guarantees the safety
invariant: the vtable’s type parameters must match the actual report
context type and handler stored in the ReportData.
§Safety Invariant
This invariant is maintained because vtables are created as &'static
references via ReportVtable::new, which pairs the function pointers
with specific types C and H at compile time.
Structs§
- Report
Vtable 🔒 - Vtable for type-erased report operations.
Functions§
- clone_
arc 🔒 ⚠ - Clones the
triomphe::Arc<ReportData<C>>pointed to by this pointer. - debug 🔒 ⚠
- Formats a report using its handler’s debug implementation.
- display 🔒 ⚠
- Formats a report using its handler’s display implementation.
- drop 🔒 ⚠
- Drops the
triomphe::Arc<ReportData<C>>instance pointed to by this pointer. - preferred_
context_ 🔒 ⚠formatting_ style - Gets the preferred formatting style using the
H::preferred_formatting_stylefunction. - source 🔒 ⚠
- Gets the source error from a report using its handler’s source implementation.
- strong_
count 🔒 ⚠ - Gets the strong count of the
triomphe::Arc<ReportData<C>>pointed to by this pointer.