It would be useful to be able to use Hashers and Hmacs in order to hash values that implement the core's Hash trait. In order to do that, Mundane's Hasher trait and Hmac type should implement the core's Hasher trait.
I suspect that, since our Hasher trait is not Clone and its finish method takes self by value, we can't just do a blanket impl - impl<H: Hasher> core::hash::Hasher for H { ... }. There would be no way to implement that trait's finish method, which takes self by immutable reference. Instead, we'll likely need to add a core::hash::Hasher bound to our Hasher trait.
For the Hmac type, it should be more straightforward.
It would be useful to be able to use
Hasher
s andHmac
s in order to hash values that implement the core'sHash
trait. In order to do that, Mundane'sHasher
trait andHmac
type should implement the core'sHasher
trait.I suspect that, since our
Hasher
trait is notClone
and itsfinish
method takesself
by value, we can't just do a blanket impl -impl<H: Hasher> core::hash::Hasher for H { ... }
. There would be no way to implement that trait'sfinish
method, which takesself
by immutable reference. Instead, we'll likely need to add acore::hash::Hasher
bound to ourHasher
trait.For the
Hmac
type, it should be more straightforward.