1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use crate::{DcsvResult, Value};
pub trait VCont {
fn new() -> Self;
fn move_row(&mut self, src_index: usize, target_index: usize) -> DcsvResult<()>;
fn move_column(&mut self, src_index: usize, target_index: usize) -> DcsvResult<()>;
fn rename_column(&mut self, column_index: usize, new_name: &str) -> DcsvResult<()>;
fn set_column(&mut self, column_index: usize, value: Value) -> DcsvResult<()>;
fn edit_row(&mut self, row_index: usize, values: &[Option<Value>]) -> DcsvResult<()>;
fn set_row(&mut self, row_index: usize, values: &[Value]) -> DcsvResult<()>;
fn get_cell(&self, x: usize, y: usize) -> Option<&Value>;
fn set_cell(&mut self, x: usize, y: usize, value: Value) -> DcsvResult<()>;
fn insert_row(&mut self, row_index: usize, source: Option<&[Value]>) -> DcsvResult<()>;
fn delete_row(&mut self, row_index: usize) -> bool;
fn insert_column(&mut self, column_index: usize, column_name: &str) -> DcsvResult<()>;
fn delete_column(&mut self, column_index: usize) -> DcsvResult<()>;
fn get_row_count(&self) -> usize;
fn get_column_count(&self) -> usize;
fn drop_data(&mut self);
fn apply_all<F: FnMut(&mut Value)>(&mut self, f: F);
}