const_panic::fmt

Struct IsPanicFmt

Source
pub struct IsPanicFmt<S: ?Sized, T: ?Sized, K> { /* private fields */ }
Expand description

A marker type that proves that S implements PanicFmt<This = T, Kind = K>.

Used by const_panic macros to coerce both standard library and user-defined types into some type that has a to_panicvals method.

Implementations§

Source§

impl<T: PanicFmt + ?Sized> IsPanicFmt<T, T::This, T::Kind>

Source

pub const NEW: Self = _

Constucts an IsPanicFmt

Source§

impl<S: ?Sized, T: ?Sized, K> IsPanicFmt<S, T, K>

Source

pub const fn infer(self, _: &S) -> Self

Infers the S type parameter with the argument.

Because the only ways to construct IsPanicFmt use IsPanicFmt<S, S::This, S::Kind>, the other type parameters are inferred along with S.

Source§

impl<S: ?Sized, T: ?Sized> IsPanicFmt<S, T, IsStdType>

Source

pub const fn coerce(self, x: &T) -> StdWrapper<&T>

For coercing &T to StdWrapper<&T>.

Source§

impl<S: ?Sized, T: ?Sized> IsPanicFmt<S, T, IsCustomType>

Source

pub const fn coerce(self, x: &T) -> &T

For coercing &T (with any amount of stacked references) to &T.

Trait Implementations§

Source§

impl<S: ?Sized, T: ?Sized, K> Clone for IsPanicFmt<S, T, K>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S: ?Sized, T: ?Sized, K> Copy for IsPanicFmt<S, T, K>

Auto Trait Implementations§

§

impl<S, T, K> Freeze for IsPanicFmt<S, T, K>
where S: ?Sized, T: ?Sized,

§

impl<S, T, K> RefUnwindSafe for IsPanicFmt<S, T, K>
where S: ?Sized, T: ?Sized,

§

impl<S, T, K> Send for IsPanicFmt<S, T, K>
where S: ?Sized, T: ?Sized,

§

impl<S, T, K> Sync for IsPanicFmt<S, T, K>
where S: ?Sized, T: ?Sized,

§

impl<S, T, K> Unpin for IsPanicFmt<S, T, K>
where S: ?Sized, T: ?Sized,

§

impl<S, T, K> UnwindSafe for IsPanicFmt<S, T, K>
where S: ?Sized, T: ?Sized,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.