RawReport

Struct RawReport 

Source
#[repr(transparent)]
pub struct RawReport { ptr: NonNull<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>>

Pointer to the inner report data

Implementations§

Source§

impl RawReport

Source

pub unsafe fn into_parts<C: 'static>( self, ) -> (C, Vec<RawReport>, Vec<RawAttachment>)

§Safety
  • The caller must ensure that the type C matches the actual context type stored in the ReportData.
  • The caller must ensure that this is the only existing reference pointing to the inner ReportData.
Source§

impl RawReport

Source

pub(super) fn from_arc<C: 'static>(data: Arc<ReportData<C>>) -> Self

Source

pub(super) fn into_non_null(self) -> NonNull<ReportData<Erased>>

Consumes the RawReport without decrementing the reference count and returns the inner pointer.

Source

pub fn new<C, H>( context: C, children: Vec<RawReport>, attachments: Vec<RawAttachment>, ) -> Self
where C: 'static, H: ContextHandler<C>,

Creates a new RawReport with the specified handler, context, children, and attachments.

Source

pub fn as_ref(&self) -> RawReportRef<'_>

Returns a reference to the ReportData instance.

Source

pub unsafe fn as_mut(&mut self) -> RawReportMut<'_>

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.

Trait Implementations§

Source§

impl Drop for RawReport

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.