bh1xuw / rust-rocks

Make RocksDB really rocks! The Rust style API.
Apache License 2.0
46 stars 7 forks source link

Questions about the project #18

Open sezaru opened 4 years ago

sezaru commented 4 years ago

First of all, thanks for the library!

I'm developing a rocksdb wrapper for Elixir language.

Currently, I'm using rust-rocksdb library instead of directly wrapping into C/C++ (for safety reasons). I recently found out about your library and became interested in maybe replace rust-rocksdb with it for my wrapper.

I just have some questions that I hope you can answer if you don't mind.

1) Is this library a long-term project? I saw that you already have more functionality implemented compared to rust-rocksdb and also I find your organization way better (ex. You separate database options from column family options) but I was wondering if you pretend to continue develop this project in the future;

2) One issue that I have with rust-rocksdb and I would probably have with your library too is lifetime objects.

For example, you need to define a lifetime to a Iterator struct, but if I want to return that iterator pointer via my wrapper (so I can use the iterator in Elixir code) it is not possible because of the lifetime.

As far as I understand, the only reason for the lifetime in Iterator is because of the PhantomData field: _marker: PhantomData<&'a ()>.

Is it possible to provide an alternative to this without this field so Rust will not complain when I try to return it? Or maybe you know some other way around it that I'm not aware.

Thanks you for your time!

bh1xuw commented 4 years ago

Is this library a long-term project?

yes, the linked version will be kept the same as what is avaliable on HomeBrew.

lifetime of iterator

The lifetime marker is used to guarantee DB lives longer than Iterator. You can use an unsafe pointer to hold it.

sezaru commented 4 years ago

Hey, thanks for the reply.

Another question, do you want PR with new features added? For example, I created a fork to add support for DBWithTtl.

bh1xuw commented 4 years ago

:) PRs are welcomed

On Tue, Sep 29, 2020 at 1:11 AM sezaru notifications@github.com wrote:

Hey, thanks for the reply.

Another question, do you want PR with new features added? For example, I created a fork to add support for DBWithTtl.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bh1xuw/rust-rocks/issues/18#issuecomment-700166451, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGUW5HAO4SYI4B2452CCKEDSIC7UPANCNFSM4RN3BCPA .