pub struct VirtualArray {
    pub columns: Vec<String>,
    pub rows: Vec<Vec<String>>,
}
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 doesn’t allow limiters. Values in VirtualArray can be indexed only with colum index.

VirtualArray has two variables which are

  • columns
  • rows

Fields

columns: Vec<String>rows: Vec<Vec<String>>

Implementations

Create empty virtual data

Set cell’s value with given string value

Move given row to a target row index

Move a given column to target column index

Rename a column

This will simply change the name of the column and doesn’t affect rows.

Set values to a column

Given value will override every row’s value

Edit a row

Only edit row’s cell when value is not none

Set values to a row

get cell data by coordinate

Insert a row to given index

This can yield out of range error

Delete a row with given row_index

This doesn’t fail but silently do nothing if index is out of range

Insert a column with given column informations

  • column_index : Position to put column
  • column_name : New column name

Delete a column with given column index

Get total rows count

Get total columns count

Drop all data from virtual data

Trait Implementations

Returns the “default value” for a type. Read more

to_string implementation for virtual array

This returns csv value string

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.