summaryrefslogtreecommitdiff
path: root/rust/src/types.rs
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2022-08-29 22:43:59 -0400
committerGlenn Smith <glenn@vector35.com>2022-09-29 21:02:22 -0400
commit8cbdc0e05adefd58e6939f7bb70d6f031277e4f6 (patch)
tree439ddd7a8eddaca0a54bb980f1ce8b46dc57399d /rust/src/types.rs
parent9fd6ed156fb926c64420c1b38b4e27f0e5c17d0a (diff)
[Rust API]: Eq for Ref<Type>
Diffstat (limited to 'rust/src/types.rs')
-rw-r--r--rust/src/types.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/rust/src/types.rs b/rust/src/types.rs
index 746142a5..0a558228 100644
--- a/rust/src/types.rs
+++ b/rust/src/types.rs
@@ -579,7 +579,7 @@ impl Drop for TypeBuilder {
//////////
// Type
-#[derive(PartialEq, Eq, Hash)]
+#[derive(Eq, Hash)]
pub struct Type {
pub(crate) handle: *mut BNType,
}
@@ -1112,6 +1112,12 @@ impl fmt::Debug for Type {
}
}
+impl PartialEq for Type {
+ fn eq(&self, other: &Self) -> bool {
+ unsafe { BNTypesEqual(self.handle, other.handle) }
+ }
+}
+
unsafe impl Send for Type {}
unsafe impl Sync for Type {}
@@ -1217,6 +1223,7 @@ impl Variable {
////////////////////////
// EnumerationBuilder
+#[derive(Debug, Clone)]
pub struct EnumerationMember {
pub name: BnString,
pub value: u64,