Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Hide PosixDiskEnv type behind a feature (default enabled) #38

Merged
merged 6 commits into from
Sep 14, 2023

Conversation

NumberFour8
Copy link
Contributor

@NumberFour8 NumberFour8 commented Sep 6, 2023

Building rusty-leveldb in constrained or non-POSIX environments (such as WASM) is currently not possible.
This PR adds small changes to make it possible.

Changes

  • Introduces fs feature which is enabled by default. The feature allows to toggle the PosixDiskEnv type and therefore makes it possible to build rusty-leveldb on systems where std::io is constrained. One major use case are WASM environments. Users can therefore set use-default-features = false on rusty-leveldb dependency entries in their Cargo.toml . The only available Env will be MemEnv if fs feature is disabled.

  • Updates rand crate to version 0.8.5 which is also WASM compatible. When the users of rusty-leveldb add getrandom dependency to their Cargo.toml, it will make the random number generation in rusty-leveldb work on their platform.

  • Adds crate-type to allow builds in different environments

  • Re-exports FileLock, RandomAccessFile and Logger types so that users can add custom implementation of the Env trait.

@dermesser
Copy link
Owner

Thank you very much! I've left a few comments, but overall it looks good.

src/lib.rs Outdated Show resolved Hide resolved
src/options.rs Outdated Show resolved Hide resolved
@NumberFour8
Copy link
Contributor Author

Thank you very much! I've left a few comments, but overall it looks good.

Thanks for the feedback :) I adapted the code according to your comments.

@NumberFour8
Copy link
Contributor Author

@dermesser Is this good to merge, then?

@dermesser dermesser merged commit 6490981 into dermesser:master Sep 14, 2023
6 checks passed
@dermesser
Copy link
Owner

Yes apologies for the delay. I will shortly release a new major version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants