1use crate::{DcsvResult, Value};
4
5pub trait VCont {
9 fn new() -> Self;
11
12 fn move_row(&mut self, src_index: usize, target_index: usize) -> DcsvResult<()>;
14
15 fn move_column(&mut self, src_index: usize, target_index: usize) -> DcsvResult<()>;
17
18 fn rename_column(&mut self, column_index: usize, new_name: &str) -> DcsvResult<()>;
20
21 fn set_column(&mut self, column_index: usize, value: Value) -> DcsvResult<()>;
23
24 fn edit_row(&mut self, row_index: usize, values: &[Option<Value>]) -> DcsvResult<()>;
26
27 fn set_row(&mut self, row_index: usize, values: &[Value]) -> DcsvResult<()>;
31
32 fn get_cell(&self, x: usize, y: usize) -> Option<&Value>;
34
35 fn set_cell(&mut self, x: usize, y: usize, value: Value) -> DcsvResult<()>;
37
38 fn insert_row(&mut self, row_index: usize, source: Option<&[Value]>) -> DcsvResult<()>;
40
41 fn delete_row(&mut self, row_index: usize) -> bool;
43
44 fn insert_column(&mut self, column_index: usize, column_name: &str) -> DcsvResult<()>;
46
47 fn delete_column(&mut self, column_index: usize) -> DcsvResult<()>;
49
50 fn get_row_count(&self) -> usize;
52
53 fn get_column_count(&self) -> usize;
55
56 fn drop_data(&mut self);
58
59 fn apply_all<F: FnMut(&mut Value)>(&mut self, f: F);
61}