pub struct VirtualData {
    pub columns: Vec<Column>,
    pub rows: Vec<Row>,
}
Expand description

Virtual data which contains csv information

VirtualData holds row information as hashmap. Therefore modifying data( cell, row or column ) is generally faster than virtual array struct. VirtualData also allows limiters to confine csv value’s possible states. Values in VirtualData can be indexed with either colum name or colum index.

Virtual data has two variables which are

  • columns
  • rows

Fields

columns: Vec<Column>rows: Vec<Row>

Implementations

Create empty virtual data

Get read only data from virtual data

This clones every value into a ReadOnlyData. If the purpose is to simply iterate over values, prefer read_only_ref method.

Get read only data from virtual data, but as reference

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

Column’s name cannot be an exsiting name

  • column : either index or column name
  • new_name : New column name

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

This assumes that given values accord to column’s order. This method will fail when given value fails to qualify column’s limiter.

get cell data by coordinate

Set cell value by coordinate

Insert a row to given index

This can yield out of rnage 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
  • column_type : Column’s type
  • limiter : Set limiter with
  • placeholder : Placeholder will be applied to every row

Delete a column with given column index

Set a limiter to a column

  • column : column’s index
  • limiter : Target limiter
  • panic : If true, failed set will occur panic

Export virtual data’s schema(limiter) as string form

Get a column index from src

Src can be either colum name or column index If colum index is out of range, it returns none

Get total rows count

Get total columns count

Drop all data from virtual data

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

to_string implementation for virtual data

This returns csv value string

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

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.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.