Struct type_equalities::TypeEq [−][src]
Evidence of the equality T == U as a zero-sized type.
assert_eq!(core::mem::size_of::<TypeEq<T, U>>(), 0);
Implementations
impl<T: ?Sized, U: ?Sized> TypeEq<T, U>[src]
impl<T: ?Sized, U: ?Sized> TypeEq<T, U>[src]pub fn trivial() -> Self where
T: IsEqual<U>, [src]
pub fn trivial() -> Self where
T: IsEqual<U>, [src]Same as crate::trivial_eq.
pub fn substitute<F: TypeFunction<T> + TypeFunction<U>>(
self,
t: ApF<F, T>
) -> ApF<F, U> where
ApF<F, T>: Sized,
ApF<F, U>: Sized, [src]
pub fn substitute<F: TypeFunction<T> + TypeFunction<U>>(
self,
t: ApF<F, T>
) -> ApF<F, U> where
ApF<F, T>: Sized,
ApF<F, U>: Sized, [src]Same as crate::substitute.
pub fn coerce(self, t: T) -> U where
T: Sized,
U: Sized, [src]
pub fn coerce(self, t: T) -> U where
T: Sized,
U: Sized, [src]Same as crate::coerce. Note that this is operationally a no-op.
Examples
assert_eq!(refl().coerce(42), 42);
pub fn lift_through<F: TypeFunction<T> + TypeFunction<U>>(
self
) -> TypeEq<ApF<F, T>, ApF<F, U>>[src]
pub fn lift_through<F: TypeFunction<T> + TypeFunction<U>>(
self
) -> TypeEq<ApF<F, T>, ApF<F, U>>[src]Lift the type equality through any TypeFunction
impl<T: ?Sized, U: ?Sized> TypeEq<T, U>[src]
impl<T: ?Sized, U: ?Sized> TypeEq<T, U>[src]pub fn use_eq<C: Consumer<T, U>>(self, c: C) -> C::Result[src]
pub fn use_eq<C: Consumer<T, U>>(self, c: C) -> C::Result[src]Use the observed equality to call the consumer to compute a result.
Consider using once of TypeEq::coerce or TypeEq::lift_through first.
Trait Implementations
impl<T: ?Sized, U: ?Sized> Copy for TypeEq<T, U>[src]
Auto Trait Implementations
impl<T, U> !Send for TypeEq<T, U>
impl<T, U> !Sync for TypeEq<T, U>
impl<T: ?Sized, U: ?Sized> Unpin for TypeEq<T, U>
Blanket Implementations
impl<T> AliasSelf for T where
T: ?Sized, [src]
impl<T> AliasSelf for T where
T: ?Sized, [src]type Alias = T
type Alias = TAlways set to Self, but the type checker doesn’t reduce T::Alias to T.
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> IsEqual<U> for T where
T: AliasSelf<Alias = U> + ?Sized,
U: ?Sized, [src]
T: AliasSelf<Alias = U> + ?Sized,
U: ?Sized,