[][src]Struct core_extensions::type_asserts::AssertEq

pub struct AssertEq<L: ?Sized, R: ?Sized> where
    L: TypeIdentity<Type = R>, 
{ /* fields omitted */ }

Struct used to assert that its type parameters are the same type.

This is most useful in tests,to make sure that types are the same.

Example

use core_extensions::type_asserts::AssertEq;

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

Non-compiling

This example deliberately fails to compile
use core_extensions::type_asserts::AssertEq;

let _:AssertEq<(),u32>;
let _=AssertEq::new( &(), &0u32 );
This example deliberately fails to compile
use core_extensions::type_asserts::AssertEq;

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

Methods

impl<A> AssertEq<A, A>[src]

pub fn new(_: A, _: A) -> Self[src]

Constructs an AssertEq.

Auto Trait Implementations

impl<L: ?Sized, R: ?Sized> RefUnwindSafe for AssertEq<L, R> where
    L: RefUnwindSafe,
    R: RefUnwindSafe

impl<L: ?Sized, R: ?Sized> Send for AssertEq<L, R> where
    L: Send,
    R: Send

impl<L: ?Sized, R: ?Sized> Sync for AssertEq<L, R> where
    L: Sync,
    R: Sync

impl<L: ?Sized, R: ?Sized> Unpin for AssertEq<L, R> where
    L: Unpin,
    R: Unpin

impl<L: ?Sized, R: ?Sized> UnwindSafe for AssertEq<L, R> where
    L: UnwindSafe,
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The error type returned when the conversion fails.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.