Add c-api/Rust wrappers for SonicV2Connector#1080
Merged
Merged
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Qi Luo <qiluo-msft@users.noreply.github.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull Request Overview
This pull request adds C-API and Rust wrappers for the SonicV2Connector functionality, providing a comprehensive interface to Redis database operations with namespace support.
- Implements complete C-API bindings for SonicV2Connector operations including connection management, key-value operations, and pattern-based operations
- Adds Rust wrapper with safe, ergonomic API and async support for all SonicV2Connector functionality
- Provides comprehensive test coverage for both C-API and Rust implementations
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| common/c-api/sonicv2connector.h | C header defining SonicV2Connector API interface |
| common/c-api/sonicv2connector.cpp | C++ implementation of SonicV2Connector C-API bindings |
| crates/swss-common/src/types/sonicv2connector.rs | Rust wrapper providing safe API over C bindings |
| tests/test_sonicv2connector_c_api.cpp | Comprehensive C++ test suite for C-API |
| crates/swss-common/tests/test_sonicv2connector.rs | Rust test suite mirroring Python functionality |
| crates/swss-common-testing/src/lib.rs | Added TEST_DB configuration for testing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
saiarcot895
reviewed
Sep 25, 2025
saiarcot895
reviewed
Sep 25, 2025
Signed-off-by: Qi Luo <qiluo-msft@users.noreply.github.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…s are UTF-8 by default
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
saiarcot895
approved these changes
Sep 25, 2025
r12f
approved these changes
Sep 26, 2025
Contributor
r12f
left a comment
There was a problem hiding this comment.
lifecycle looks good to me! drops calls delete and internal resources covered by RAII.
Collaborator
|
Cherry-pick PR to msft-202506: Azure/sonic-swss-common.msft#72 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds c-api/Rust wrappers for SonicV2Connector and EventPublisher, so they will be available for Rust application development. Also add unit tests for c-api and Rust wrappers.