summaryrefslogtreecommitdiff
path: root/bindgen/callbacks.rs
AgeCommit message (Collapse)Author
2023-01-20Implement cli option for custom derive (#2328)Dan Dumont
* custom derives after DeriveInfo * Introduce `TypeKind` instead of `CompKind` * Add tests * Emit CLI flags for callbacks * update changelog * run rustfmt * fix tests * fix features Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
2022-11-28Document callback changes and avoid static lifetime (#2366)Christian Poveda Ruiz
2022-11-28Extend `generated_name_override` callback to variables (#2351)Justin W Smith
* This change updates `ParseCallbacks::generated_name_override` to accept a second parameter indicating the kind of item the name applies to (currently, either `Function` or `Var`). * A `CallbackItemKind` enum was added to serve as the type for this second parameter. * Tests have been updated to verify that the names of both function and variable can be updated by this callback.
2022-11-22Add `ParseCallbacks::process_comment` (#2347)Christian Poveda Ruiz
This method can be used to process comments and replace them with whatever the user wants.
2022-11-21Introduce `DeriveInfo` (#2355)Christian Poveda Ruiz
This PR introduces a new non-exhaustive `struct` called `DeriveInfo` to be used as the sole argument of `ParseCallbacks::add_derives` with the purpose of being able to extend the information passed to this method in a backwards-compatible manner, meaning that adding new fields to `DeriveInfo` won't be a breaking change when releasing a new version.
2022-10-22Use panic hooks instead of using `catch_unwind`Christian Poveda
One of the advantages of doing this is that `ParseCallbacks` no longer needs to implement `UnwindSafe` which means that users can rely on `RefCell` and `Cell` to extract information from the callbacks. Users relying on `catch_unwind` can still achieve similar behavior using `std::thread::spawn`. Fixes #2147.
2022-10-06Merge branch 'master' into generated_name_overrideJustin Smith
2022-10-04split the repo into a workspaceChristian Poveda
remove `clap` dependency :tada: update the book installation instructions