#[repr(transparent)]pub struct RawReportMut<'a> {
ptr: NonNull<ReportData<Erased>>,
_marker: PhantomData<&'a mut ReportData<Erased>>,
}Expand description
A mutable lifetime-bound 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.
We cannot use a &'a mut ReportData<C> directly, because that would require
us to know the actual type of the context, which we do not.
Fields§
§ptr: NonNull<ReportData<Erased>>Pointer to the inner report data
_marker: PhantomData<&'a mut ReportData<Erased>>Marker to tell the compiler that we should
behave the same as a &'a mut ReportData<Erased>
Implementations§
Source§impl<'a> RawReportMut<'a>
impl<'a> RawReportMut<'a>
Sourcepub fn into_children_mut(self) -> &'a mut Vec<RawReport>
pub fn into_children_mut(self) -> &'a mut Vec<RawReport>
Gets a mutable reference to the child reports.
Sourcepub fn into_attachments_mut(self) -> &'a mut Vec<RawAttachment>
pub fn into_attachments_mut(self) -> &'a mut Vec<RawAttachment>
Gets a mutable reference to the attachments.
Sourcepub unsafe fn into_context_downcast_unchecked<C: 'static>(self) -> &'a mut C
pub unsafe fn into_context_downcast_unchecked<C: 'static>(self) -> &'a mut C
Accesses the inner context of the ReportData instance as a mutable reference to the specified type.
§Safety
The caller must ensure that the type C matches the actual context type stored in the ReportData.
Source§impl<'a> RawReportMut<'a>
impl<'a> RawReportMut<'a>
Sourcepub(super) unsafe fn cast_inner<C: CastTo>(
self,
) -> &'a mut ReportData<C::Target>
pub(super) unsafe fn cast_inner<C: CastTo>( self, ) -> &'a mut ReportData<C::Target>
Casts the RawReportMut to a mutable ReportData<C> reference.
§Safety
The caller must ensure that the type C matches the actual context type stored in the ReportData.
Sourcepub fn reborrow<'b>(&'b mut self) -> RawReportMut<'b>
pub fn reborrow<'b>(&'b mut self) -> RawReportMut<'b>
Reborrows the mutable reference to the ReportData with a shorter lifetime.
Sourcepub fn as_ref(&self) -> RawReportRef<'_>
pub fn as_ref(&self) -> RawReportRef<'_>
Returns a reference to the ReportData instance.
Sourcepub fn into_ref(self) -> RawReportRef<'a>
pub fn into_ref(self) -> RawReportRef<'a>
Consumes the mutable reference and returns an immutable one with the same lifetime.
Sourcepub(super) fn into_mut_ptr(self) -> *mut ReportData<Erased>
pub(super) fn into_mut_ptr(self) -> *mut ReportData<Erased>
Consumes this RawReportMut and returns a raw mutable pointer to the underlying ReportData.
This method is primarily used for internal operations that require direct pointer access.