Struct core_extensions::type_asserts::AssertEq4
source · [−]pub struct AssertEq4<A: ?Sized, B: ?Sized, C: ?Sized, D: ?Sized> where
A: TypeIdentity<Type = B>,
A: TypeIdentity<Type = C>,
A: TypeIdentity<Type = D>, { /* private fields */ }
type_asserts
only.Expand description
Asserts that its 4 type parameters are the same type.
This assertion is done on the type level,
so let _: AssertEq4<A, B, C, D>;
requires that
A
, B
, C
, and D
must be the same type.
Example
use core_extensions::type_asserts::AssertEq4;
trait TypeParams {
type First;
type Second;
type Third;
}
impl<A, B, C> TypeParams for (A, B, C) {
type First = A;
type Second = B;
type Third = C;
}
type First<T> = <T as TypeParams>::First;
type Second<T> = <T as TypeParams>::Second;
type Third<T> = <T as TypeParams>::Third;
let _: AssertEq4<
u32,
First <(u32, (), ())>,
Second<((), u32, ())>,
Third <((), (), u32)>,
>;
let _ = AssertEq4::new(&0u32, &0u32, &0u32, &0u32);
Non-compiling
let _: AssertEq4<(), u32, u32, u32>;
let _ = AssertEq4::new(&(), &0u32, &0u32, &0u32);
let _: AssertEq4<u32, (), u32, u32>;
let _ = AssertEq4::new(&0u32, &(), &0u32, &0u32);
let _: AssertEq4<u32, u32, (), u32>;
let _ = AssertEq4::new(&0u32, &0u32, &(), &0u32);
let _: AssertEq4<u32, u32, u32, ()>;
let _ = AssertEq4::new(&0u32, &0u32, &0u32, &());
Implementations
Auto Trait Implementations
impl<A: ?Sized, B: ?Sized, C: ?Sized, D: ?Sized> RefUnwindSafe for AssertEq4<A, B, C, D> where
A: RefUnwindSafe,
B: RefUnwindSafe,
C: RefUnwindSafe,
D: RefUnwindSafe,
impl<A: ?Sized, B: ?Sized, C: ?Sized, D: ?Sized> Send for AssertEq4<A, B, C, D> where
A: Send,
B: Send,
C: Send,
D: Send,
impl<A: ?Sized, B: ?Sized, C: ?Sized, D: ?Sized> Sync for AssertEq4<A, B, C, D> where
A: Sync,
B: Sync,
C: Sync,
D: Sync,
impl<A: ?Sized, B: ?Sized, C: ?Sized, D: ?Sized> Unpin for AssertEq4<A, B, C, D> where
A: Unpin,
B: Unpin,
C: Unpin,
D: Unpin,
impl<A: ?Sized, B: ?Sized, C: ?Sized, D: ?Sized> UnwindSafe for AssertEq4<A, B, C, D> where
A: UnwindSafe,
B: UnwindSafe,
C: UnwindSafe,
D: UnwindSafe,
Blanket Implementations
sourceimpl<T> AsPhantomData for T where
T: ?Sized,
impl<T> AsPhantomData for T where
T: ?Sized,
sourcefn as_phantom(&self) -> PhantomData<Self>
fn as_phantom(&self) -> PhantomData<Self>
phantom
only.Gets a PhantomData<Self>
. Read more
sourcefn as_phantom_covariant(&self) -> PhantomData<fn() -> Self>
fn as_phantom_covariant(&self) -> PhantomData<fn() -> Self>
phantom
only.Gets a PhantomData<fn() -> Self>
, a covariant PhantomData
.
sourcefn as_phantom_contra(&self) -> PhantomData<fn(_: Self)>
fn as_phantom_contra(&self) -> PhantomData<fn(_: Self)>
phantom
only.Gets a PhantomData<fn(Self)>
, a contravariant PhantomData
.
sourcefn as_phantom_invariant(&self) -> PhantomData<fn(_: Self) -> Self>
fn as_phantom_invariant(&self) -> PhantomData<fn(_: Self) -> Self>
phantom
only.Gets a PhantomData<fn(Self) -> Self>
, an invariant PhantomData
.
sourceconst PHANTOM: PhantomData<Self> = PhantomData
const PHANTOM: PhantomData<Self> = PhantomData
phantom
only.Gets a PhantomData<Self>
. Read more
sourceconst PHANTOM_COVARIANT: PhantomData<fn() -> Self> = PhantomData
const PHANTOM_COVARIANT: PhantomData<fn() -> Self> = PhantomData
phantom
only.Constructs a PhantomData<fn() -> T>
, a covariant PhantomData
. Read more
sourceconst PHANTOM_CONTRA: PhantomData<fn(_: Self)> = PhantomData
const PHANTOM_CONTRA: PhantomData<fn(_: Self)> = PhantomData
phantom
only.Gets a PhantomData<fn(Self)>
, a contravariant PhantomData
. Read more
sourceconst PHANTOM_INVARIANT: PhantomData<fn(_: Self) -> Self> = PhantomData
const PHANTOM_INVARIANT: PhantomData<fn(_: Self) -> Self> = PhantomData
phantom
only.Gets a PhantomData<fn(Self) -> Self>
, an invariant PhantomData
. Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallExt for T where
T: ?Sized,
impl<T> CallExt for T where
T: ?Sized,
sourcefn ref_call<P>(&self, params: P) -> Self::Returns where
Self: CallRef<P>,
fn ref_call<P>(&self, params: P) -> Self::Returns where
Self: CallRef<P>,
callable
only.For calling CallRef::ref_call_
,
with the ability to specify the types of the arguments.. Read more