pub trait TEq<T> {
    fn teq(self) -> T;
    fn teq_ref(&self) -> &T;
    fn teq_mut(&mut self) -> &mut T;
}
Expand description

A trait witnessing that two types are equal.

For example:

use gazebo::types::TEq;
fn foo<A : TEq<String>>(x: A) -> String {
   x.teq()
}

You should not make any further implementations of this trait.

Originally taken from a request to have Rust allow equality constraints in traits, from Issue 20041.

Required Methods

Convert between two equal types.

Convert between references to two equal types.

Convert between mutable references to two equal types.

Implementors