@@ -22,6 +22,7 @@ use binaryninjacore_sys::*;
2222use binaryninjacore_sys:: { BNCreateDatabaseWithProgress , BNOpenExistingDatabaseWithProgress } ;
2323use std:: ffi:: c_void;
2424use std:: fmt:: { Debug , Display , Formatter } ;
25+ use std:: hash:: { Hash , Hasher } ;
2526use std:: path:: { Path , PathBuf } ;
2627
2728use crate :: progress:: { NoProgressCallback , ProgressCallback } ;
@@ -108,7 +109,6 @@ unsafe impl RefCountable for SaveSettings {
108109/// **Important**: Because [`FileMetadata`] holds a strong reference to the [`BinaryView`]s and those
109110/// views hold a strong reference to the file metadata, to end the cyclic reference a call to the
110111/// [`FileMetadata::close`] is required.
111- #[ derive( PartialEq , Eq , Hash ) ]
112112pub struct FileMetadata {
113113 pub ( crate ) handle : * mut BNFileMetadata ,
114114}
@@ -612,6 +612,20 @@ impl Display for FileMetadata {
612612 }
613613}
614614
615+ impl PartialEq for FileMetadata {
616+ fn eq ( & self , other : & Self ) -> bool {
617+ self . session_id ( ) == other. session_id ( )
618+ }
619+ }
620+
621+ impl Eq for FileMetadata { }
622+
623+ impl Hash for FileMetadata {
624+ fn hash < H : Hasher > ( & self , state : & mut H ) {
625+ self . session_id ( ) . hash ( state) ;
626+ }
627+ }
628+
615629unsafe impl Send for FileMetadata { }
616630unsafe impl Sync for FileMetadata { }
617631
0 commit comments