pub trait VCont {
Show 17 methods
// Required methods
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);
}Expand description
Generic trait over both virtual_data and virtual_array
This provides some genral methods over csv value manipulation
Required Methods§
Sourcefn move_row(&mut self, src_index: usize, target_index: usize) -> DcsvResult<()>
fn move_row(&mut self, src_index: usize, target_index: usize) -> DcsvResult<()>
Move a given row to a target row index
Sourcefn move_column(
&mut self,
src_index: usize,
target_index: usize,
) -> DcsvResult<()>
fn move_column( &mut self, src_index: usize, target_index: usize, ) -> DcsvResult<()>
Move a given column to target column index
Sourcefn rename_column(
&mut self,
column_index: usize,
new_name: &str,
) -> DcsvResult<()>
fn rename_column( &mut self, column_index: usize, new_name: &str, ) -> DcsvResult<()>
Rename a column
Sourcefn set_column(&mut self, column_index: usize, value: Value) -> DcsvResult<()>
fn set_column(&mut self, column_index: usize, value: Value) -> DcsvResult<()>
Set values to a column
Sourcefn edit_row(
&mut self,
row_index: usize,
values: &[Option<Value>],
) -> DcsvResult<()>
fn edit_row( &mut self, row_index: usize, values: &[Option<Value>], ) -> DcsvResult<()>
Edit a row
Sourcefn set_row(&mut self, row_index: usize, values: &[Value]) -> DcsvResult<()>
fn set_row(&mut self, row_index: usize, values: &[Value]) -> DcsvResult<()>
Set values to a row
This assumes that given values accord to column’s order.
Sourcefn set_cell(&mut self, x: usize, y: usize, value: Value) -> DcsvResult<()>
fn set_cell(&mut self, x: usize, y: usize, value: Value) -> DcsvResult<()>
Set cell value by coordinate
Sourcefn insert_row(
&mut self,
row_index: usize,
source: Option<&[Value]>,
) -> DcsvResult<()>
fn insert_row( &mut self, row_index: usize, source: Option<&[Value]>, ) -> DcsvResult<()>
Insert a row to given index
Sourcefn delete_row(&mut self, row_index: usize) -> bool
fn delete_row(&mut self, row_index: usize) -> bool
Delete a row with given row_index
Sourcefn insert_column(
&mut self,
column_index: usize,
column_name: &str,
) -> DcsvResult<()>
fn insert_column( &mut self, column_index: usize, column_name: &str, ) -> DcsvResult<()>
Insert a column with given column informations
Sourcefn delete_column(&mut self, column_index: usize) -> DcsvResult<()>
fn delete_column(&mut self, column_index: usize) -> DcsvResult<()>
Delete a column with given column index
Sourcefn get_row_count(&self) -> usize
fn get_row_count(&self) -> usize
Get total rows count
Sourcefn get_column_count(&self) -> usize
fn get_column_count(&self) -> usize
Get total columns count
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.