File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -69,15 +69,34 @@ pub(crate) fn get_num_chunks(ds: &Dataset) -> Option<usize> {
69
69
mod one_thirteen {
70
70
use super :: * ;
71
71
use hdf5_sys:: h5d:: H5Dchunk_iter ;
72
+
72
73
/// Borrowed version of [ChunkInfo](crate::dataset::ChunkInfo)
73
- #[ derive( Debug ) ]
74
+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
74
75
pub struct ChunkInfoBorrowed < ' a > {
75
76
pub offset : & ' a [ u64 ] ,
76
77
pub filter_mask : u32 ,
77
78
pub addr : u64 ,
78
79
pub size : u64 ,
79
80
}
80
81
82
+ impl < ' a > ChunkInfoBorrowed < ' a > {
83
+ /// Returns positional indices of disabled filters.
84
+ pub fn disabled_filters ( & self ) -> Vec < usize > {
85
+ ( 0 ..32 ) . filter ( |i| self . filter_mask & ( 1 << i) != 0 ) . collect ( )
86
+ }
87
+ }
88
+
89
+ impl < ' a > From < ChunkInfoBorrowed < ' a > > for ChunkInfo {
90
+ fn from ( val : ChunkInfoBorrowed < ' a > ) -> Self {
91
+ Self {
92
+ offset : val. offset . to_owned ( ) ,
93
+ filter_mask : val. filter_mask ,
94
+ addr : val. addr ,
95
+ size : val. size ,
96
+ }
97
+ }
98
+ }
99
+
81
100
struct RustCallback < F > {
82
101
ndims : usize ,
83
102
callback : F ,
You can’t perform that action at this time.
0 commit comments