pub struct AssertEq3<A: ?Sized, B: ?Sized, C: ?Sized> where
    A: TypeIdentity<Type = B>,
    A: TypeIdentity<Type = C>, 
{ /* private fields */ }
Available on crate feature type_asserts only.
Expand description

Asserts that its 3 type parameters are the same type.

This assertion is done on the type level, so let _: AssertEq3<A, B, C>; requires that A, B, and C must be the same type.

Example

use core_extensions::type_asserts::AssertEq3;

trait TypeParams {
    type First;
    type Second;
}

impl<A, B> TypeParams for (A, B) {
    type First = A;
    type Second = B;
}

type First<T> = <T as TypeParams>::First;

type Second<T> = <T as TypeParams>::Second;

let _: AssertEq3<u32, First<(u32, ())>, Second<((), u32)>>;

let _ = AssertEq3::new(&0u32, &0u32, &0u32);

Non-compiling

let _: AssertEq3<(), u32, u32>;
let _ = AssertEq3::new(&(), &0u32, &0u32);
let _: AssertEq3<u32, (), u32>;
let _ = AssertEq3::new(&0u32, &(), &0u32);
let _: AssertEq3<u32, u32, ()>;
let _ = AssertEq3::new(&0u32, &0u32, &());

Implementations

Constructs an AssertEq3.

Constructs an AssertEq3.

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.