match-by-hash

Crates.iomatch-by-hash
lib.rsmatch-by-hash
version1.0.1
sourcesrc
created_at2023-12-15 19:06:45.962399
updated_at2023-12-15 19:22:34.588148
descriptionMatch statement, but for any value and with a hash function
homepage
repositoryhttps://codeberg.org/lch361/match-by-hash
max_upload_size
id1071198
size7,558
(lch361)

documentation

README

Need to match one string among many? Or maybe not even strings, but something else in large quantities? Then this crate is for you.

Features

  • Supports custom hash functions. However, only those that can be evaluated at compile time.
  • Key types get compared with == to check if the key is right.
  • It also checks at compile time for hash collisions (but only in debug builds).

Notes

  • This macro is unable to come up with perfect hash function on its own. If you see errors due to collisions, then you're gonna need a better hash function.
Commit count: 0

cargo fmt