Code review request for bbolt-rs, my nigh 7000 line port of the bbolt database

Hello!

After many weeks of work I'd like to submit my latest obsession for code review. I ported the better part of the etcd-io/bbolt database into Rust over the last month and a half. It can run read and rw transactions in the same manner as bbolt, but I've explicitly disallowed reading bbolt databases until I have finished with the unit test shakedown. The first 80% is done. Now it's time for the next 80%.

Please find the code at my imaginatively named bbolt-rs project. Most of the unsafe involves reading memory mapped files, but I'm sure there's a bit of unsafe that doesn't need to exist. Additionally, I know I'm using pin incorrectly. Additionally, clippy complains that where I'm using Arc use won't work because nothing is Send or Sync. I'm inexperienced in those areas. Feedback especially there would be helpful. I know what I need to do, but I'm not sure how to do it.

Features:

  • Arena memory allocation per transaction
  • Explicitly designed to prevent transaction dependant resources from escaping the transaction.
  • RwLock based transactions
  • File backed database
  • Memory backed database for Miri to use
  • Simple and straightforward public APIs

I know the code is a bit of a mess and unorganized, but it'll get there eventually. If you have any questions please let me know!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.