#[repr(transparent)]pub struct RawReport {
ptr: NonNull<ReportData<Erased>>,
_marker: PhantomData<ReportData<Erased>>,
}Expand description
A pointer to a ReportData that is guaranteed to point to an initialized instance
of a ReportData<C> for some specific C, though we do not know which actual C it is.
However, the pointer is allowed to transition into a non-initialized state inside the
RawReport::drop method.
The pointer is guaranteed to have been created using triomphe::Arc::into_raw.
We cannot use a triomphe::OffsetArc<ReportData<C>> directly, because that does not allow
us to type-erase the C.
Fields§
§ptr: NonNull<ReportData<Erased>>§_marker: PhantomData<ReportData<Erased>>Implementations§
Source§impl RawReport
impl RawReport
Sourcepub unsafe fn into_parts<C: 'static>(
self,
) -> (C, Vec<RawReport>, Vec<RawAttachment>)
pub unsafe fn into_parts<C: 'static>( self, ) -> (C, Vec<RawReport>, Vec<RawAttachment>)
§Safety
- The caller must ensure that the type
Cmatches the actual context type stored in theReportData. - The caller must ensure that this is the only existing reference pointing to
the inner
ReportData.
Source§impl RawReport
impl RawReport
Sourcepub(super) fn from_arc<C: 'static>(data: Arc<ReportData<C>>) -> Self
pub(super) fn from_arc<C: 'static>(data: Arc<ReportData<C>>) -> Self
Creates a new RawReport from a triomphe::Arc<ReportData<C>>.
Sourcepub(super) fn into_non_null(self) -> NonNull<ReportData<Erased>>
pub(super) fn into_non_null(self) -> NonNull<ReportData<Erased>>
Consumes the RawReport without decrementing the reference count and returns the inner pointer.
Sourcepub fn new<C, H>(
context: C,
children: Vec<RawReport>,
attachments: Vec<RawAttachment>,
) -> Selfwhere
C: 'static,
H: ContextHandler<C>,
pub fn new<C, H>(
context: C,
children: Vec<RawReport>,
attachments: Vec<RawAttachment>,
) -> Selfwhere
C: 'static,
H: ContextHandler<C>,
Creates a new RawReport with the specified handler, context, children, and attachments.
Sourcepub fn as_ref<'a>(&'a self) -> RawReportRef<'a>
pub fn as_ref<'a>(&'a self) -> RawReportRef<'a>
Returns a reference to the ReportData instance.
Sourcepub unsafe fn as_mut<'a>(&'a mut self) -> RawReportMut<'a>
pub unsafe fn as_mut<'a>(&'a mut self) -> RawReportMut<'a>
Returns a mutable reference to the ReportData instance.
§Safety
The caller must ensure that this is the only existing reference pointing to
the inner ReportData.