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

Add: Rust bindings generate using bindgen #243

Merged
merged 7 commits into from
Jan 27, 2023

Conversation

chungquantin
Copy link

Generate bindings code using bindgen. Implement two simple methods to open / close database using the following ukv_database_init() and ukv_database_Free().

Contributors

  • chungquantin

Added

  • Database structure
struct Database {
 db: UkvDatabaseInitType
}
  • Build bindings to cpp header file in include/ukv. To generate bindings code stored, use cargo build. build.rs includes code to build bindings using bindgen
  • Support two APIs: ukv_database_init and ukv_database_free
  • Add clippy, rust-fmt and editor config file for formatting and linting

Issues

  • Can't generate bindings on file with linked source header. For example, generate on file blobs.h which includes ukv/db.h would throw error No header file found.

Generate bindings code using bindgen. Implement two simple methods to open / close database using the following ukv_database_init() and ukv_database_Free()
@chungquantin chungquantin mentioned this pull request Jan 27, 2023
michaelgrigoryan25 and others added 6 commits January 27, 2023 09:40
- Implemented std::default::Default for Database and cleaned up the
  implementation of Database::new.
- Updated Cargo build script. The bindings will be generated on the
  fly and will be put in `OUT_DIR`. Bindings will be linked directly
  to the crate, without the need to keep them tracked in git.
@chungquantin chungquantin changed the base branch from dev to 238-rust-bindings January 27, 2023 15:28
@ashvardanian ashvardanian merged commit 720497a into unum-cloud:238-rust-bindings Jan 27, 2023
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.

3 participants