-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Draft: subclass: Add missing BuildableImpl vfuncs #900
base: main
Are you sure you want to change the base?
Conversation
I haven't got the time to clean things up, will get back to it pretty soon i hope |
); | ||
fn custom_tag_end( | ||
tag_name: &str, | ||
parser_data: *mut *mut libc::c_void, |
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.
How is this pointer used exactly?
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.
It is used to pass the state to the BuildableParser, my idea was to create a struct that implements a certain trait and move the struct around instead of passing a random ptr around
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.
Sounds like a good plan :) Where would the struct be freed, is the finish()
function guaranteed to be called exactly once with the same parser data, for example?
} | ||
} | ||
|
||
pub unsafe trait BuildableParserImpl: Sized { |
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.
Why does it have to be unsafe?
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.
It shouldn't, I made it unsafe at first before figuring out what the user_data pointers are used for. Ideally once this PR is ready, we shouldn't need that
No description provided.