5
5
use intmap:: IntMap ;
6
6
use std:: { collections:: HashMap , fmt} ;
7
7
8
- pub mod row;
9
- pub mod collumn;
10
8
pub mod collection;
9
+ pub mod collumn;
10
+ pub mod row;
11
11
12
12
#[ derive( Clone , Debug ) ]
13
13
pub struct Channel < ' a > {
@@ -32,8 +32,8 @@ pub struct DataCellChangeRecord<T>
32
32
where
33
33
T : fmt:: Display ,
34
34
{
35
- pub row_index : i64 ,
36
- pub column_index : i64 ,
35
+ pub row_index : usize ,
36
+ pub column_index : usize ,
37
37
pub old_value : T ,
38
38
pub new_value : T ,
39
39
}
@@ -42,7 +42,7 @@ impl<T> DataCellChangeRecord<T>
42
42
where
43
43
T : fmt:: Display ,
44
44
{
45
- fn new ( row_index : i64 , column_index : i64 , old_value : T , new_value : T ) -> Self {
45
+ fn new ( row_index : usize , column_index : usize , old_value : T , new_value : T ) -> Self {
46
46
Self {
47
47
row_index,
48
48
column_index,
@@ -95,7 +95,7 @@ impl fmt::Display for DataCollectionChangeRecord {
95
95
pub trait TableEntity { }
96
96
97
97
#[ derive( Clone ) ]
98
- pub struct DataStream < ' a , M , D >
98
+ pub struct DataStream < ' a , M , D >
99
99
where
100
100
M : fmt:: Display ,
101
101
D : fmt:: Display ,
@@ -111,27 +111,27 @@ where
111
111
// rowsChangeController: StreamController<DataCollectionChangeRecord>,
112
112
}
113
113
114
- impl < ' a , M , D > Default for DataStream < ' a , M , D >
114
+ impl < ' a , M , D > Default for DataStream < ' a , M , D >
115
115
where
116
116
M : fmt:: Display ,
117
117
D : fmt:: Display ,
118
118
{
119
119
fn default ( ) -> Self {
120
- Self {
120
+ Self {
121
121
meta : Vec :: new ( ) ,
122
122
frames : Vec :: new ( ) ,
123
123
}
124
124
}
125
125
}
126
126
127
- impl < ' a , M , D > DataStream < ' a , M , D >
127
+ impl < ' a , M , D > DataStream < ' a , M , D >
128
128
where
129
129
M : fmt:: Display ,
130
130
D : fmt:: Display ,
131
131
{
132
132
/// Creates a [DataTable] with optional data [data].
133
133
///
134
- /// * 'metadata ' - contains row names
134
+ /// * 'meta ' - contains row names
135
135
///
136
136
/// The first row in [data] contains the column names.
137
137
/// The data type of each column is determined by the first non-null value
@@ -140,7 +140,7 @@ where
140
140
/// All values in each column are expected to be of the same type,
141
141
/// and all rows are expected to have the same length.
142
142
// data is optional
143
- pub fn new ( metadata : Vec < Channel > , data : Vec < DataFrame < M , D > > ) -> Self {
143
+ pub fn new ( meta : Vec < Channel < ' a > > , frames : Vec < DataFrame < M , D > > ) -> Self {
144
144
// let data_table = DataTable {
145
145
// // column_index_by_name: Default::default(),
146
146
// // columns: None,
@@ -161,7 +161,7 @@ where
161
161
// }
162
162
163
163
// rows.add_all(data);
164
- unimplemented ! ( )
164
+ Self { meta , frames }
165
165
}
166
166
167
167
fn on_cell_changed ( row_index : i64 , column_index : i64 , old_value : String , new_value : String ) {
@@ -270,7 +270,6 @@ where
270
270
// }
271
271
}
272
272
273
-
274
273
#[ cfg( test) ]
275
274
mod tests {
276
275
#[ test]
0 commit comments