pub trait TypeEq: Sized {
// Required methods
fn type_hash<H: Hasher>(&self, hasher: &mut H, types: &MetaTypes);
fn type_eq(&self, other: &Self, types: &MetaTypes) -> bool;
// Provided methods
fn type_hash_slice<H: Hasher>(
slice: &[Self],
hasher: &mut H,
types: &MetaTypes,
) { ... }
fn type_eq_iter<'a, X, Y>(x: X, y: Y, types: &MetaTypes) -> bool
where Self: 'a,
X: IntoIterator<Item = &'a Self>,
Y: IntoIterator<Item = &'a Self> { ... }
}Expand description
Trait to check if two types are equal to each other or not.
This trait will automatically resolve type definitions to its target type before it compares the two instances. This means a type is considered as equal, if all type identifiers point to the same type and all normal values are equal.
Required Methods§
Provided Methods§
Sourcefn type_hash_slice<H: Hasher>(slice: &[Self], hasher: &mut H, types: &MetaTypes)
fn type_hash_slice<H: Hasher>(slice: &[Self], hasher: &mut H, types: &MetaTypes)
Feeds a slice of this value into the given Hasher.
Sourcefn type_eq_iter<'a, X, Y>(x: X, y: Y, types: &MetaTypes) -> boolwhere
Self: 'a,
X: IntoIterator<Item = &'a Self>,
Y: IntoIterator<Item = &'a Self>,
fn type_eq_iter<'a, X, Y>(x: X, y: Y, types: &MetaTypes) -> boolwhere
Self: 'a,
X: IntoIterator<Item = &'a Self>,
Y: IntoIterator<Item = &'a Self>,
Check if the two passed iterators contain type equal elements.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.