Struct std::io::error::repr_bitpacked::Repr

source ·
#[repr(transparent)]
pub(super) struct Repr(NonNull<()>, PhantomData<ErrorData<Box<Custom>>>);
Expand description

The internal representation.

See the module docs for more, this is just a way to hack in a check that we indeed are not unwind-safe.

fn is_unwind_safe<T: core::panic::UnwindSafe>() {}
is_unwind_safe::<std::io::Error>();
Run

Tuple Fields§

§0: NonNull<()>§1: PhantomData<ErrorData<Box<Custom>>>

Implementations§

source§

impl Repr

source

pub(super) fn new(dat: ErrorData<Box<Custom>>) -> Self

source

pub(super) fn new_custom(b: Box<Custom>) -> Self

source

pub(super) fn new_os(code: RawOsError) -> Self

source

pub(super) fn new_simple(kind: ErrorKind) -> Self

source

pub(super) const fn new_simple_message(m: &'static SimpleMessage) -> Self

source

pub(super) fn data(&self) -> ErrorData<&Custom>

source

pub(super) fn data_mut(&mut self) -> ErrorData<&mut Custom>

source

pub(super) fn into_data(self) -> ErrorData<Box<Custom>>

Trait Implementations§

source§

impl Debug for Repr

source§

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

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

impl Drop for Repr

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Send for Repr

source§

impl Sync for Repr

Auto Trait Implementations§

§

impl !RefUnwindSafe for Repr

§

impl Unpin for Repr

§

impl !UnwindSafe for Repr

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.