pub struct AssertEq<L: ?Sized, R: ?Sized> where
    L: TypeIdentity<Type = R>, 
{ /* private fields */ }
Available on crate feature type_asserts only.
Expand description

Asserts that its 2 type parameters are the same type.

This assertion is done on the type level, so let _: AssertEq<T, U>; requires that T must be the same type as U.

Example

use core_extensions::type_asserts::AssertEq;

trait ElemTy {
    type Elem;
}

impl<A> ElemTy for (A,) {
    type Elem = A;
}

let _: AssertEq<u32, <(u32,) as ElemTy>::Elem>;

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

Non-compiling

use core_extensions::type_asserts::AssertEq;

let _: AssertEq<(), u32>;
let _ = AssertEq::new(&(), &0u32);
use core_extensions::type_asserts::AssertEq;

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

Implementations

Constructs an AssertEq.

Constructs an AssertEq.

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.