FFI Layer: Implement RSValueTrait for FFI and implement the C entry point - MOD-9985#6459
FFI Layer: Implement RSValueTrait for FFI and implement the C entry point - MOD-9985#6459
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6459 +/- ##
==========================================
- Coverage 89.67% 89.28% -0.39%
==========================================
Files 257 259 +2
Lines 42217 42798 +581
Branches 4519 5089 +570
==========================================
+ Hits 37857 38212 +355
- Misses 4291 4503 +212
- Partials 69 83 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
Implements a new FFI layer exposing the Rust RSValue and RSSortingVector functionality to C.
- Adds
RSValueFFIwrapper over C’sRSValuewith reference counting andRSValueTraitimplementation. - Generates and updates the C header (
sorting_vector_rs.h) viacbindgen. - Provides C entry points (
RSSortingVector_*functions) in Rust for creating, querying, and freeing sorting vectors.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/redisearch_rs/value/src/lib.rs | FFI wrapper RSValueFFI implementing RSValueTrait |
| src/redisearch_rs/headers/sorting_vector_rs.h | Auto-generated C header for RSSortingVector API |
| src/redisearch_rs/c_entrypoint/sorting_vector_ffi/src/lib.rs | Rust implementations of C entry points for sorting vector operations |
| src/redisearch_rs/c_entrypoint/sorting_vector_ffi/cbindgen.toml | Configuration for header generation via cbindgen |
| src/redisearch_rs/c_entrypoint/sorting_vector_ffi/build.rs | Build script invoking cbindgen |
Comments suppressed due to low confidence (1)
src/redisearch_rs/c_entrypoint/sorting_vector_ffi/src/lib.rs:165
- The attribute
#[unsafe(no_mangle)]is invalid Rust syntax. It should be#[no_mangle]above the function signature.
#[unsafe(no_mangle)]
3c2ed44 to
ac79dd0
Compare
a3f0bc5 to
41460a9
Compare
nafraf
left a comment
There was a problem hiding this comment.
Just a question in the autogenerated file: src/redisearch_rs/headers/sorting_vector_rs.h
What is part of this PR?
This PR adds the FFI layer that is used by the upcoming
RSSortingVectorport. It allows C to use theRSSortingVectorRust implementation.For this, the type
RSValueFFIis created. It implements the traitRSValueTraitand is used temporarily until theRSValuetype is ported to Rust.Referenced PRs
Stacked on top of: #6311
Upcoming PR:
Full swap of C with Rust Implementation: #6397