pub struct VirtualArray {
pub columns: Vec<Column>,
pub rows: Vec<Vec<Value>>,
}Expand description
Virtual array which contains csv information in a form of arrays.
- VirtualArray holds row information as vectors. Therefore indexing is generally faster than virtual data struct.
- VirtualArray allows duplicate columns
- VirtualArray doesn’t allow limiters.
Fields§
§columns: Vec<Column>§rows: Vec<Vec<Value>>Trait Implementations§
Source§impl Clone for VirtualArray
impl Clone for VirtualArray
Source§fn clone(&self) -> VirtualArray
fn clone(&self) -> VirtualArray
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for VirtualArray
impl Default for VirtualArray
Source§impl Display for VirtualArray
to_string implementation for virtual array
impl Display for VirtualArray
to_string implementation for virtual array
This returns csv value string
Source§impl VCont for VirtualArray
impl VCont for VirtualArray
Source§fn 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
This will simply change the name of the column and doesn’t affect rows.
Source§fn 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
Given value will override every row’s value
Source§fn 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
Only edit row’s cell when value is not none
Source§fn 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
This can yield out of range error
Source§fn delete_row(&mut self, row_index: usize) -> bool
fn delete_row(&mut self, row_index: usize) -> bool
Delete a row with given row_index
This doesn’t fail but silently do nothing if index is out of range
Source§fn 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
- column_index : Position to put column
- column_name : New column name
Source§fn delete_column(&mut self, column_index: usize) -> DcsvResult<()>
fn delete_column(&mut self, column_index: usize) -> DcsvResult<()>
Delete a column with given column index
Source§fn 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
Source§fn get_row_count(&self) -> usize
fn get_row_count(&self) -> usize
Get total rows count
Source§fn get_column_count(&self) -> usize
fn get_column_count(&self) -> usize
Get total columns count
Source§fn 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
Source§fn 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
Auto Trait Implementations§
impl Freeze for VirtualArray
impl RefUnwindSafe for VirtualArray
impl Send for VirtualArray
impl Sync for VirtualArray
impl Unpin for VirtualArray
impl UnwindSafe for VirtualArray
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more