@@ -608,6 +608,12 @@ impl std::fmt::Debug for semun {
608608 }
609609}
610610#[ cfg( feature = "extra_traits" ) ]
611+ impl std:: hash:: Hash for semun {
612+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
613+ unsafe { self . val . hash ( state) } ;
614+ }
615+ }
616+ #[ cfg( feature = "extra_traits" ) ]
611617impl PartialEq for proc_threadinfo {
612618 fn eq ( & self , other : & proc_threadinfo ) -> bool {
613619 self . pth_user_time == other. pth_user_time
@@ -648,6 +654,22 @@ impl std::fmt::Debug for proc_threadinfo {
648654 }
649655}
650656#[ cfg( feature = "extra_traits" ) ]
657+ impl std:: hash:: Hash for proc_threadinfo {
658+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
659+ self . pth_user_time . hash ( state) ;
660+ self . pth_system_time . hash ( state) ;
661+ self . pth_cpu_usage . hash ( state) ;
662+ self . pth_policy . hash ( state) ;
663+ self . pth_run_state . hash ( state) ;
664+ self . pth_flags . hash ( state) ;
665+ self . pth_sleep_time . hash ( state) ;
666+ self . pth_curpri . hash ( state) ;
667+ self . pth_priority . hash ( state) ;
668+ self . pth_maxpriority . hash ( state) ;
669+ self . pth_name . hash ( state) ;
670+ }
671+ }
672+ #[ cfg( feature = "extra_traits" ) ]
651673impl PartialEq for statfs {
652674 fn eq ( & self , other : & statfs ) -> bool {
653675 self . f_bsize == other. f_bsize
@@ -702,6 +724,27 @@ impl std::fmt::Debug for statfs {
702724 }
703725}
704726#[ cfg( feature = "extra_traits" ) ]
727+ impl std:: hash:: Hash for statfs {
728+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
729+ self . f_bsize . hash ( state) ;
730+ self . f_iosize . hash ( state) ;
731+ self . f_blocks . hash ( state) ;
732+ self . f_bfree . hash ( state) ;
733+ self . f_bavail . hash ( state) ;
734+ self . f_files . hash ( state) ;
735+ self . f_ffree . hash ( state) ;
736+ self . f_fsid . hash ( state) ;
737+ self . f_owner . hash ( state) ;
738+ self . f_flags . hash ( state) ;
739+ self . f_fssubtype . hash ( state) ;
740+ self . f_fstypename . hash ( state) ;
741+ self . f_type . hash ( state) ;
742+ self . f_mntonname . hash ( state) ;
743+ self . f_mntfromname . hash ( state) ;
744+ self . f_reserved . hash ( state) ;
745+ }
746+ }
747+ #[ cfg( feature = "extra_traits" ) ]
705748impl PartialEq for dirent {
706749 fn eq ( & self , other : & dirent ) -> bool {
707750 self . d_ino == other. d_ino
@@ -732,6 +775,17 @@ impl std::fmt::Debug for dirent {
732775 }
733776}
734777#[ cfg( feature = "extra_traits" ) ]
778+ impl std:: hash:: Hash for dirent {
779+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
780+ self . d_ino . hash ( state) ;
781+ self . d_seekoff . hash ( state) ;
782+ self . d_reclen . hash ( state) ;
783+ self . d_namlen . hash ( state) ;
784+ self . d_type . hash ( state) ;
785+ self . d_name . hash ( state) ;
786+ }
787+ }
788+ #[ cfg( feature = "extra_traits" ) ]
735789impl PartialEq for pthread_rwlock_t {
736790 fn eq ( & self , other : & pthread_rwlock_t ) -> bool {
737791 self . __sig == other. __sig
@@ -754,6 +808,13 @@ impl std::fmt::Debug for pthread_rwlock_t {
754808 }
755809}
756810#[ cfg( feature = "extra_traits" ) ]
811+ impl std:: hash:: Hash for pthread_rwlock_t {
812+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
813+ self . __sig . hash ( state) ;
814+ self . __opaque . hash ( state) ;
815+ }
816+ }
817+ #[ cfg( feature = "extra_traits" ) ]
757818impl PartialEq for pthread_mutex_t {
758819 fn eq ( & self , other : & pthread_mutex_t ) -> bool {
759820 self . __sig == other. __sig
@@ -776,6 +837,13 @@ impl std::fmt::Debug for pthread_mutex_t {
776837 }
777838}
778839#[ cfg( feature = "extra_traits" ) ]
840+ impl std:: hash:: Hash for pthread_mutex_t {
841+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
842+ self . __sig . hash ( state) ;
843+ self . __opaque . hash ( state) ;
844+ }
845+ }
846+ #[ cfg( feature = "extra_traits" ) ]
779847impl PartialEq for pthread_cond_t {
780848 fn eq ( & self , other : & pthread_cond_t ) -> bool {
781849 self . __sig == other. __sig
@@ -798,6 +866,13 @@ impl std::fmt::Debug for pthread_cond_t {
798866 }
799867}
800868#[ cfg( feature = "extra_traits" ) ]
869+ impl std:: hash:: Hash for pthread_cond_t {
870+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
871+ self . __sig . hash ( state) ;
872+ self . __opaque . hash ( state) ;
873+ }
874+ }
875+ #[ cfg( feature = "extra_traits" ) ]
801876impl PartialEq for sockaddr_storage {
802877 fn eq ( & self , other : & sockaddr_storage ) -> bool {
803878 self . ss_len == other. ss_len
@@ -830,6 +905,16 @@ impl std::fmt::Debug for sockaddr_storage {
830905 }
831906}
832907#[ cfg( feature = "extra_traits" ) ]
908+ impl std:: hash:: Hash for sockaddr_storage {
909+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
910+ self . ss_len . hash ( state) ;
911+ self . ss_family . hash ( state) ;
912+ self . __ss_pad1 . hash ( state) ;
913+ self . __ss_align . hash ( state) ;
914+ self . __ss_pad2 . hash ( state) ;
915+ }
916+ }
917+ #[ cfg( feature = "extra_traits" ) ]
833918impl PartialEq for utmpx {
834919 fn eq ( & self , other : & utmpx ) -> bool {
835920 self . ut_user
@@ -866,6 +951,19 @@ impl std::fmt::Debug for utmpx {
866951 . finish ( )
867952 }
868953}
954+ #[ cfg( feature = "extra_traits" ) ]
955+ impl std:: hash:: Hash for utmpx {
956+ fn hash < H : std:: hash:: Hasher > ( & self , state : & mut H ) {
957+ self . ut_user . hash ( state) ;
958+ self . ut_id . hash ( state) ;
959+ self . ut_line . hash ( state) ;
960+ self . ut_pid . hash ( state) ;
961+ self . ut_type . hash ( state) ;
962+ self . ut_tv . hash ( state) ;
963+ self . ut_host . hash ( state) ;
964+ self . ut_pad . hash ( state) ;
965+ }
966+ }
869967
870968pub const _UTX_USERSIZE: usize = 256 ;
871969pub const _UTX_LINESIZE: usize = 32 ;
0 commit comments