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

[yang2] into_raw for Bindings #22

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

yodaldevoid
Copy link
Contributor

This adds an Bindings::into_raw to allow turning any Binding into its raw pointer.

I need this as I am modifying sysrepo-rs to remove all libyang bindings, replacing them with the ones from this crate.

@yodaldevoid yodaldevoid force-pushed the into_raw_yang2 branch 2 times, most recently from 6628579 to fdb469f Compare December 1, 2024 14:36
@yodaldevoid
Copy link
Contributor Author

The CI tests were not run due to the workflow file in yang2 only specifying master. This, and other CI issues, is fixed in #23.

@yodaldevoid yodaldevoid force-pushed the into_raw_yang2 branch 2 times, most recently from f0dc7e4 to 57337d7 Compare December 8, 2024 12:24
Copy link

codecov bot commented Dec 8, 2024

Codecov Report

Attention: Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.

Project coverage is 56.40%. Comparing base (4e5b2bd) to head (57337d7).

Files with missing lines Patch % Lines
src/schema.rs 0.00% 16 Missing ⚠️
src/data.rs 0.00% 15 Missing ⚠️
src/context.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            yang2      #22      +/-   ##
==========================================
- Coverage   57.20%   56.40%   -0.80%     
==========================================
  Files           7        7              
  Lines        2124     2154      +30     
==========================================
  Hits         1215     1215              
- Misses        909      939      +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yodaldevoid yodaldevoid force-pushed the into_raw_yang2 branch 2 times, most recently from 17a79b7 to 5cc7948 Compare December 8, 2024 20:54
Adds methods to get the raw pointer to the libyang structures held by
many structures. into_raw has been implemented where the struct manages
the pointer (has a Drop impl to free/release the internal struture),
and as_raw has been implemented where the struct is just a wrapper.
@rwestphal rwestphal merged commit 996153e into holo-routing:yang2 Dec 10, 2024
3 checks passed
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