Skip to main content

Custom

Struct Custom 

Source
#[doc(hidden)]
#[repr(align(4))]
pub struct Custom { kind: ErrorKind, error: NonNull<dyn Error + Send + Sync>, error_drop: unsafe fn(*mut dyn Error + Send + Sync), outer_drop: unsafe fn(*mut Self), }
🔬This is a nightly-only experimental API. (core_io_internals)

Fields§

§kind: ErrorKind
🔬This is a nightly-only experimental API. (core_io_internals)
§error: NonNull<dyn Error + Send + Sync>
🔬This is a nightly-only experimental API. (core_io_internals)
§error_drop: unsafe fn(*mut dyn Error + Send + Sync)
🔬This is a nightly-only experimental API. (core_io_internals)
§outer_drop: unsafe fn(*mut Self)
🔬This is a nightly-only experimental API. (core_io_internals)

Implementations§

Source§

impl Custom

Source

pub unsafe fn from_raw( kind: ErrorKind, error: NonNull<dyn Error + Send + Sync>, error_drop: unsafe fn(*mut dyn Error + Send + Sync), outer_drop: unsafe fn(*mut Self), ) -> Custom

🔬This is a nightly-only experimental API. (core_io_internals)
§Safety
  • error must be valid for up to a static lifetime, and own its pointee.
  • error_drop must be safe to call for the pointer error exactly once.
  • outer_drop must be safe to call on a pointer to this instance of Custom if it were stored within a CustomOwner.
Source

pub fn into_raw(self) -> NonNull<dyn Error + Send + Sync>

🔬This is a nightly-only experimental API. (core_io_internals)
Source

fn error_ref(&self) -> &(dyn Error + Send + Sync + 'static)

🔬This is a nightly-only experimental API. (core_io #154046)
Source

fn error_mut(&mut self) -> &mut (dyn Error + Send + Sync + 'static)

🔬This is a nightly-only experimental API. (core_io #154046)

Trait Implementations§

Source§

impl Debug for Custom

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Custom

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics #130494)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for Custom

Source§

impl Sync for Custom