Implement Hash and PartialOrd for RingBuf

cc #15294
Ah I think it's ok, they can be amended in the future. Hashing to the same value isn't really the end of the world, so long as the comparisons are correct!