Skip to content

Commit 97c8903

Browse files
committed
feat: add Debug,Clone,Eq traits to callback objects
Add common traits like `Debug` to the callback objects like `ItemKind` and `ItemInfo`.
1 parent ef8aa88 commit 97c8903

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bindgen/callbacks.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ pub enum DiscoveredItem {
248248

249249
/// Relevant information about a type to which new derive attributes will be added using
250250
/// [`ParseCallbacks::add_derives`].
251-
#[derive(Debug)]
251+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
252252
#[non_exhaustive]
253253
pub struct DeriveInfo<'a> {
254254
/// The name of the type.
@@ -259,7 +259,7 @@ pub struct DeriveInfo<'a> {
259259

260260
/// Relevant information about a type to which new attributes will be added using
261261
/// [`ParseCallbacks::add_attributes`].
262-
#[derive(Debug)]
262+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
263263
#[non_exhaustive]
264264
pub struct AttributeInfo<'a> {
265265
/// The name of the type.
@@ -280,7 +280,7 @@ pub enum TypeKind {
280280
}
281281

282282
/// A struct providing information about the item being passed to [`ParseCallbacks::generated_name_override`].
283-
#[derive(Clone, Copy)]
283+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
284284
#[non_exhaustive]
285285
pub struct ItemInfo<'a> {
286286
/// The name of the item
@@ -290,7 +290,7 @@ pub struct ItemInfo<'a> {
290290
}
291291

292292
/// An enum indicating the kind of item for an `ItemInfo`.
293-
#[derive(Clone, Copy)]
293+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
294294
#[non_exhaustive]
295295
pub enum ItemKind {
296296
/// A module
@@ -305,7 +305,7 @@ pub enum ItemKind {
305305

306306
/// Relevant information about a field for which visibility can be determined using
307307
/// [`ParseCallbacks::field_visibility`].
308-
#[derive(Debug)]
308+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
309309
#[non_exhaustive]
310310
pub struct FieldInfo<'a> {
311311
/// The name of the type.

0 commit comments

Comments
 (0)