-
Notifications
You must be signed in to change notification settings - Fork 14
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
[yang3] into_raw
for Bindings
#21
Conversation
The failing CI tests are unrelated to this PR and are fixed in #24. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. Please see the inline review comments.
Overall, some yang-rs types own data, while others are simple references. So the semantics of into_raw
isn't always clear, for some types as_raw
would be more appropriate. We could potentially implement either into_raw
or as_raw
directly on the types instead of having the into_raw
trait method. What do you think?
Seems reasonable to me. I had a feeling that this wasn't quite right, but had to start somewhere. I'll try to figure out where to implement |
58669cf
to
6b06826
Compare
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent. Thank you!
This adds an
Bindings::into_raw
to allow turning anyBinding
into its raw pointer.I need this as I am modifying
sysrepo-rs
to remove alllibyang
bindings, replacing them with the ones from this crate.