ion-rust icon indicating copy to clipboard operation
ion-rust copied to clipboard

`ion-hash` feature should be compatible with `std::hash::Hash`

Open popematt opened this issue 2 years ago • 0 comments

Sometimes you want to put Elements in a set. The available sets in the Rust std lib are HashSet (requires Hash and Eq) and BTreeSet (requires Ord). Since we do not have a total ordering over all Ion values, the BTreeSet is out of the picture. We do have a hashing specification for Ion that is already implemented in ion-rust as the ion-hash feature, and so if we could make it compatible with the Hash trait, then we could put Elements in a HashSet or use them as the key for a HashMap.

popematt avatar Mar 29 '23 19:03 popematt