#llvm #parsing #binary #encoding

llvm-bitcursor

A no-frills bitstream cursor library for Rust

9 releases

0.0.3 Jan 28, 2022
0.0.2 Nov 18, 2021
0.0.2-rc.10 Aug 11, 2021
0.0.2-rc.3 Jul 25, 2021

#2562 in Parser implementations

Download history 8/week @ 2023-10-18 16/week @ 2023-10-25 18/week @ 2023-11-01 11/week @ 2023-11-08 12/week @ 2023-11-15 28/week @ 2023-11-22 26/week @ 2023-11-29 24/week @ 2023-12-06 16/week @ 2023-12-13 17/week @ 2023-12-20 15/week @ 2023-12-27 6/week @ 2024-01-03 10/week @ 2024-01-10 34/week @ 2024-01-17 13/week @ 2024-01-24 15/week @ 2024-01-31

72 downloads per month
Used in 2 crates (via llvm-bitstream)

MIT license

32KB
564 lines

llvm-bitcursor

Crates.io Documentation

A no-frills cursor library that supports reading unaligned fields from a bitstream.

This library primarily exists to provide low-level support for the task of parsing LLVM's bitstream format. If you're looking for a general purpose bitvector handling library, try bitvec or bit-vec.

Features:

  • No-copy, all cursor state is internal
  • Support for LLVM's VBR encoding (requires the vbr feature)
  • 100% safe Rust, with #![forbid(unsafe_code)]
  • No use of unwrap, expect, or panic

Anti-features:

  • Not a general purpose bitvector/bitstring handling library
  • Probably not very fast
  • Doesn't care about bit order (always LSB-first)

Dependencies

~0.8–1.3MB
~30K SLoC