impl_core_hash!() { /* proc-macro */ }
Expand description

Implement core::Hash::Hash for types that already implement Hash.

// Implements `::core::Hash:Hash` for `MyType`.
impl_core_hash!(MyType);

You can pass multiple types as arguments. Types are separated by ;.

// Implements `::core::Hash:Hash` for `MyOtherType<u32>` and `MyOtherType<u64>`.
impl_core_hash!(MyOtherType<u32>; MyOtherType<u64>);

You can also pass generic types using the impl keyword.

// Implements `::core::Hash:Hash` for `MyType` and `MyOtherType`.
impl_core_hash! {
    impl<T> MyType<T>;
    impl<'a, T, U: 'a> MyOtherType<'a, T, u32, U> where Self: Display;
}