#[repr(transparent)]pub struct RawReportRef<'a> {
ptr: NonNull<ReportData<Erased>>,
_marker: PhantomData<&'a ReportData<Erased>>,
}Expand description
A 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 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>>§_marker: PhantomData<&'a ReportData<Erased>>Implementations§
Source§impl<'a> RawReportRef<'a>
impl<'a> RawReportRef<'a>
Sourcepub(super) fn vtable(self) -> &'static ReportVtable
pub(super) fn vtable(self) -> &'static ReportVtable
Returns a reference to the ReportVtable of the ReportData instance.
Sourcepub fn attachments(self) -> &'a [RawAttachment]
pub fn attachments(self) -> &'a [RawAttachment]
Returns the attachments of this report.
Sourcepub unsafe fn context_downcast_unchecked<C: 'static>(self) -> &'a C
pub unsafe fn context_downcast_unchecked<C: 'static>(self) -> &'a C
Accesses the inner context of the ReportData instance as a 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> RawReportRef<'a>
impl<'a> RawReportRef<'a>
Sourcepub(super) unsafe fn cast_inner<C: CastTo>(self) -> &'a ReportData<C::Target>
pub(super) unsafe fn cast_inner<C: CastTo>(self) -> &'a ReportData<C::Target>
Casts the RawReportRef to a ReportData<C> reference.
§Safety
The caller must ensure that the type C matches the actual context type stored in the ReportData.
Sourcepub(super) fn as_ptr(self) -> *const ReportData<Erased>
pub(super) fn as_ptr(self) -> *const ReportData<Erased>
Returns a NonNull pointer to the ReportData instance.
Sourcepub fn context_type_id(self) -> TypeId
pub fn context_type_id(self) -> TypeId
Returns the TypeId of the context.
Sourcepub fn context_handler_type_id(self) -> TypeId
pub fn context_handler_type_id(self) -> TypeId
Returns the TypeId of the context.
Sourcepub fn context_downcast<C: 'static>(self) -> Option<&'a C>
pub fn context_downcast<C: 'static>(self) -> Option<&'a C>
Checks if the type of the context matches the specified type and returns a reference to it if it does.
Sourcepub fn context_source(self) -> Option<&'a (dyn Error + 'static)>
pub fn context_source(self) -> Option<&'a (dyn Error + 'static)>
Returns the source of the context using the ContextHandler::source method
specified when the ReportData was created.
Sourcepub fn context_display(self, formatter: &mut Formatter<'_>) -> Result
pub fn context_display(self, formatter: &mut Formatter<'_>) -> Result
Formats the context by using the ContextHandler::display method
specified by the handler used to create the ReportData.
Sourcepub fn context_debug(self, formatter: &mut Formatter<'_>) -> Result
pub fn context_debug(self, formatter: &mut Formatter<'_>) -> Result
Formats the context by using the ContextHandler::debug method
specified by the handler used to create the ReportData.
Sourcepub fn preferred_context_formatting_style(
self,
report_formatting_function: FormattingFunction,
) -> ContextFormattingStyle
pub fn preferred_context_formatting_style( self, report_formatting_function: FormattingFunction, ) -> ContextFormattingStyle
Sourcepub unsafe fn clone_arc(self) -> RawReport
pub unsafe fn clone_arc(self) -> RawReport
Clones the inner triomphe::Arc and returns a new RawReport pointing to the same data.
§Safety
There must be no external assumptions that there is unique ownership of the triomphe::Arc.
Sourcepub fn strong_count(self) -> usize
pub fn strong_count(self) -> usize
Gets the strong_count of the inner triomphe::Arc.
Trait Implementations§
Source§impl<'a> Clone for RawReportRef<'a>
impl<'a> Clone for RawReportRef<'a>
Source§fn clone(&self) -> RawReportRef<'a>
fn clone(&self) -> RawReportRef<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more