pub struct Processor { /* private fields */ }
Expand description

Csv processor

Processor has multiple pages which can be accessed with page_name. Processor has currently selected page which name can be accessed with get_cursor method.

Implementations

Main loop struct for interactive csv editing

Execute given command

Create empty processor

Change current cusor(page)

This doesn’t affect page itself but change cursor.

  • This returns boolean value whether change succeeded or not

Get current cursor (page_name)

Add a new page

Args
  • page : Page name to create
  • data : Csv data to store inside a page
  • has_header : Whether csv data has header or not.
  • line_ending : Optional line_ending configuration.
  • raw_mode : This decides whether page be data or array

Remove page with given name

This doesn’t panic and silent do nothing if page name is non-existent

Check if processor contains a page

Drop all data from processor

Import file content as page

This will drop the page if given page name already exists.

Args
  • path: File path to import from
  • has_header : Whether csv file has header or not
  • line_ending : Optional line_ending of csv
  • raw_mode : Whether imported as data or array

Write all page’s content into a file

Overwrite virtual data’s content into a imported file

  • cache : whether to backup original file’s content into temp directory

Edit a cell by given coordinate

Edit a column by given coordinate

This overwrite all column values with given input

Edit a row with values

This assumes given input accords with order of a target record.

Args
  • page : Page name
  • row_index : Target row
  • input : Inputs are array of options. Some will overwrite and none will not.

Set a row with given values

This assumes given input accords with order of a target record. This method overwrite an entire row with given values.

Set a row with given string array

This assumes given input accords with order of a target record. This method overwrite an entire row with given values.

Add a new row

This assumes given input accords with order of a target record.

Args
  • page: Target page
  • row_index : Target row
  • values : Option. “None” will converted as default values.

Add a new row but from array of strings

This assumes given input accords with order of a target record.

Args
  • page: Target page
  • row_index : Target row
  • values : Option. “None” will converted as default values.

Add a new column into a page

Remove a row from a page

Remove a column from a page

Add columns into a page

This method dosn’t require any column configurators

Move a rom from an index to a target index

Move a column from an index to a target index

Rename a column into a new name

Export page’s schema

Apply schema into a given page

Args
  • page : Page name
  • path : Schema file path
  • panic : Whether to panic if current value fails to qualify schema. If not every unqualified values are overwritten to default qualifying values.

Set a limiter to a column

Args
  • page : Page name
  • column : Target column name(index)
  • limiter : A limiter to apply to column
  • panic : Whether to panic if current value fails to qualify liimter. If not, every unqualified values are overwritten to default qualifying values.

Get last row index

Get last column index

Get virtual data as string form

Get cell from page

This fails when page or coordinate doesn’t exist

Get column from page

This fails when either page or column doesn’t exist

Get column from page by name

This fails when either page or column doesn’t exist

Trait Implementations

Returns the “default value” for a type. 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.

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.