Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
We wrote an extensive library for bit packing a few years ago. I never managed to release it to crates, but we do use it heavily internally (and it's super well tested and reasonably well documented). It has a slightly different perspective, making extensive use of typenum: This is a single bitfield implementation: https://gitlab.com/SmartAcoustics/sparrow/-/blob/master/sparrow-bitpacker/src/bitfields.rs with more extensive usage here: https://gitlab.com/SmartAcoustics/sparrow/-/blob/0932659068ea1bafeceb66b9b70a0abde89937d0/sparrow-registers/examples/register_map.rs
Possible reference as it requires to use the compiler as part of language abi: https://github.com/Vexu/arocc/issues/178 Not sure, where a better thread with explanations of the flaws is.
Love the syntax, it's super clean! I've been a big fan of https://github.com/wrenger/bitfield-struct-rs, but this library might give it a run for it's money.
I opened an issue on this here.