Struct dcsv::VirtualArray
source · [−]Expand description
Virtual data 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
sourceimpl Clone for VirtualArray
impl Clone for VirtualArray
sourcefn clone(&self) -> VirtualArray
fn clone(&self) -> VirtualArray
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Default for VirtualArray
impl Default for VirtualArray
sourceimpl Display for VirtualArray
impl Display for VirtualArray
to_string implementation for virtual array
This returns csv value string
sourceimpl VCont for VirtualArray
impl VCont for VirtualArray
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
This will simply change the name of the column and doesn’t affect rows.
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
Given value will override every row’s value
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
Only edit row’s cell when value is not none
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
This can yield out of range error
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
This doesn’t fail but silently do nothing if index is out of range
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
- column_index : Position to put column
- column_name : New column name
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 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 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
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 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 RefUnwindSafe for VirtualArray
impl Send for VirtualArray
impl Sync for VirtualArray
impl Unpin for VirtualArray
impl UnwindSafe for VirtualArray
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more