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 */ }
Available on crate feature 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

Constructs an AssertEq4.

Constructs an AssertEq4.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Available on crate feature phantom only.

Gets a PhantomData<Self>. Read more

Available on crate feature phantom only.

Gets a PhantomData<fn() -> Self>, a covariant PhantomData.

Available on crate feature phantom only.

Gets a PhantomData<fn(Self)>, a contravariant PhantomData.

Available on crate feature phantom only.

Gets a PhantomData<fn(Self) -> Self>, an invariant PhantomData.

Available on crate feature phantom only.

Gets a PhantomData<Self>. Read more

Available on crate feature phantom only.

Constructs a PhantomData<fn() -> T>, a covariant PhantomData. Read more

Available on crate feature phantom only.

Gets a PhantomData<fn(Self)>, a contravariant PhantomData. Read more

Available on crate feature phantom only.

Gets a PhantomData<fn(Self) -> Self>, an invariant PhantomData. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Available on crate feature callable only.

For calling CallRef::ref_call_, with the ability to specify the types of the arguments.. Read more

Available on crate feature callable only.

For calling CallMut::mut_call_, with the ability to specify the types of the arguments.. Read more

Available on crate feature callable only.

For calling CallInto::into_call_, with the ability to specify the types of the arguments.. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.