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

Virtual data struct 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 cannot have duplicate column name due to previous hashmap implementaiton
  • VirtualData allows limiters to confine csv value’s possible states.

Fields

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

Implementations

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

This will fail if the value cannot be converted to column’s type

Insert a column with given column informations

Args
  • 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

Set a limiter to a column

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

Qualify data and get reference of qualifed rows.

Qualify data with multiple limiters and get reference of qualifed rows.

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

Schema is expressed as csv value. Each line is structured with following order.

  • column
  • type
  • default
  • variant
  • pattern

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 iterator.

This methods returns iterator which respects column orders

Get iterator of a row with given index

This respects columns orders

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.

Create empty virtual data

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 : column_index
  • 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

Delete a column with given column index

Get total rows count

Get total columns count

Drop all data from virtual data

Apply closure to all values

Insert a column with given column informations

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.